第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

如何將對(duì)象發(fā)送到 Vue elementui 中的子組件

如何將對(duì)象發(fā)送到 Vue elementui 中的子組件

墨色風(fēng)雨 2022-08-18 09:57:21
我是 vue 的新手。所以這是我的 vue 模板<template><div class="app-container">  <el-dialog :visible="dialogVisible"             title="View order"             :before-close="() => dialogVisible = false">    <order-form :oneorder="oneorderdata" @success="handleAdd" @cancel="dialogVisible = false" />  </el-dialog>  <el-table v-loading="loading" :data="orders" border>    <el-table-column prop="order.id" label="Id" />    <el-table-column prop="order.fullName" label="Full Name" />    <el-table-column prop="order.address.name" label="Address" />    <el-table-column prop="order.status" label="Status" />    <el-table-column label="View" prop="order.id" min-width="150">      <template slot-scope="{row}">      <el-col style="flex: 0">        <el-button icon="el-icon-plus" type="primary" @click="senddata(row.order)">          View Order        </el-button>      </el-col>    </template>    </el-table-column>  </el-table></div></template>當(dāng)我點(diǎn)擊按鈕時(shí),對(duì)話框是真的,所以我調(diào)用訂單組件,我想向它傳遞數(shù)據(jù)。組件正常打開,但錯(cuò)誤說找不到一個(gè)orderview,盡管我在發(fā)送數(shù)據(jù)方法中正常在控制臺(tái)中顯示它。我試過了v-bind:oneorder="oneorderview"但它不起作用,它沒有顯示任何錯(cuò)誤。提前致謝。這是我的腳本<script>  import Vue from "vue";  import Component from "vue-class-component";  import { getOrders } from "@/api/store";  import dataStore from "@/store/modules/data";  import { OrderView } from "../../../models";  import { OrderInput } from "@/models";  import DataModule from "@/store/modules/data";  import OrderForm from "./form.vue";  type _OrderInput = OrderInput;  interface TableRowData {    editMode: boolean;    order: OrderView;    editedOrder: _OrderInput;  }  @Component({    components: {      OrderForm,    },  })  export default class Orders extends Vue {    orders: TableRowData[] = [];    oneorderview: any;    loading = false;    dialogVisible = false;    searchKey = "";    async created() {      await DataModule.ensureLoaded();      this.fetchData();    }    async fetchData() {      this.loading = true;      await dataStore.loadorders();      if (dataStore.orders.hasLoaded) {以及如何處理子組件中的數(shù)據(jù)。
查看完整描述

1 回答

?
侃侃無極

TA貢獻(xiàn)2051條經(jīng)驗(yàn) 獲得超10個(gè)贊

你在 Vue typescript 中使用了類組件。要傳遞 props,你需要使用經(jīng)典的 Vue 屬性,或者通過注釋你的類成員:


import { Component, Prop } from 'vue-property-decorator'


@Component

export default class App extends Vue {

  // Makes a "exampleProperty" a component prop with the default value of 'Example'

  @Prop({default: 'Example'})

  exampleProperty: string

}


查看完整回答
反對(duì) 回復(fù) 2022-08-18
  • 1 回答
  • 0 關(guān)注
  • 128 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)