<!DOCTYPE html><html><head><meta charset="UTF-8"><title>Document</title><link rel="stylesheet" href="style.css"><script type="text/javascript" src="https://cdn.bootcss.com/vue/2.2.2/vue.min.js"></script></head><body><div class="{{ classValue }}">{{ innerText }}{{ classValue }}</div><script type="text/javascript" src="script.js"></script></body></html>
.app{ color: red;}
window.onload = function(){ var dataList = { classValue:'app', innerText:'大家好,哈哈' }; new Vue({ el:'div', data:dataList });}
想给div绑定一个class为app,这样为什么不能绑定上?
相关分类