情況是這樣的,項目用了elimentui,并把table組件封裝了一個子組件,內部片段的column是這樣的://子組件內部{{item.content?item.content(scope.row):scope.row[item.name]}}//這一行其中fields是數據的每個字段用到了循環,字段的顯示內容content()返回為文本時沒問題。但是如果想自定義這個內部的樣式,必須添加一個button,就不行了。一下是組件內的data部分://父組件的data:...fields:[{title:'時間',width:"180",content:(row)=>{//這里字符是沒有問題的returnnewDate(row.start).format("MM-ddhh:mm")+"~"+newDate(row.end).format("hh:mmD")+(row.clash!=null?"[有沖突]":"")}},{name:"user_name",title:'姓名',width:'80'},{name:'product_name',title:'課程',content:(row)=>{return"有問題的地方";//->求解的地方}},{name:'title',title:'課題'},...],...結果輸出的時候吧"有問題的地方"當文本輸出了。就不知道怎么辦了。求解。大神在不?
vuejs如何在子組件內輸出參數中的html
慕森王
2019-05-21 16:27:57
