鍍金池/ 問答/網(wǎng)絡(luò)安全  HTML/ vue這個(gè)為什么報(bào)錯(cuò)?

vue這個(gè)為什么報(bào)錯(cuò)?

<!DOCTYPE html>
<html>
<head>
    <title></title>
    <style type="text/css">
    .test{color: red}
    </style>
    <script src="vue.js"></script>
    <script type="text/javascript">
        window.onload=function(){
            let obj={
                message:'hahha'
            }
            new Vue({
                el:"#app",
                data:obj
            })
        }
    </script>
</head>
<body>
<div id="app">
    <span v-bind:class="test">{{message}}</span>
</div>
</body>
</html>

提示:

[Vue warn]: Property or method "test" is not defined on the instance but referenced during render. Make sure that this property is reactive, either in the data option, or for class-based components, by initializing the property. 
回答
編輯回答
嘟尛嘴

你的vue中未聲明test變量或者未定義test函數(shù)

2017年10月18日 07:24