0
當我向組件中添加數據目標時,它將停止顯示這些元素。我試圖harcoding的ID,但不管我做它dosent有數據顯示目標:組件中的Vue數據目標
Vue.component('kk-directory', {
props: ['directoryData'],
template: '<li>'+
'<input type="checkbox" v-model="directoryData.Selected" v-on:change=" $root.selectedChange(directoryData)" v-show="!directoryData.Migrate">'+
'<span class="glyphicon glyphicon-check" ng-click="selectChilds(directoryData)"></span>'+
'<a href="#" v-on:click="!directoryData.Loaded && $root.add(directoryData)" data-toggle="collapse" **:data-target="#'+'{{directoryData.DirectoryId}}">**'+
'<b>{{ directoryData.Name }}:</b>'+
'<span>files({{ directoryData.FileCountCurrentFolder }})</span>, files total (<span ng-class="{\'danger\': directoryData.FileCountTotal > 5000}">{{ directoryData.FileCountTotal }}</span>), <span>GB ({{ directoryData.SizeGB }})</span>'+
'</a>'+
'<ul id="{{directoryData.DirectoryId}}" class="">'+
'<li v-for="dir in directoryData.Childs">'+
'<kk-directory :directory-data="dir"></kk-directory >'+
'</li>'+
'</ul>'+
'</li>'
})
是在無法將數據目標組件綁定?
您的代碼有太多的問題!什麼是'**',你關閉'''''' – imcvampire
你可能會考慮模板字符串,而不是''' –
Sry the ** is stackoverflow bold。所以忽略它們,我認爲它正確關閉'? –