javascript - Vue动态挂载的组件不渲染bootsrtap的class样式
天蓬老师
天蓬老师 2017-04-11 11:53:20
0
0
391

-被挂载的组件

var addType = { template: '

'+ '

添加新闻分类

'+ '

'+ ''+ ''+ ''+ ''+ ''+ ''+ '
分类名称
父分类名称'+ ''+ '
'+ ''+ '

'+ '

', mounted: function(){ var that = this; $.get("mook/addTypeC.php","",function(response){ that.options = JSON.parse(response); }); }, data: function(){ return { options: [{'tname':'国际新闻'},{'tname':'体育新闻'}] }; }, }

-挂载组件:

var appMain = new Vue({ el: "#app", data: { currentView: 'defaultView' }, components: { 'defaultView': defaultView, 'typeList': typeList, 'addType': addType } });

-点击挂载的代码

var appMenu = { template: {/* */}, methods: { //处理分类列表的函数 typeList: function(){ appMain.currentView = typeList; }, //处理添加分类的函数 addType: function(){ appMain.currentView = addType; } } }
  • 显示效果如图: 点击左侧按键触发typeList函数,table样式没有渲染出来

  • 但是为什么在chrome控制台编辑html文档,在该p前面加了一个空格就可以渲染出来table样式了

天蓬老师
天蓬老师

欢迎选择我的课程,让我们一起见证您的进步~~

全員に返信 (0)
最新のダウンロード
詳細>
ウェブエフェクト
公式サイト
サイト素材
フロントエンドテンプレート
私たちについて 免責事項 Sitemap
PHP中国語ウェブサイト:福祉オンライン PHP トレーニング,PHP 学習者の迅速な成長を支援します!