vue
Vue对象
const app=new Vue({
el: "#app",
data: {
message: "hello vue",
array: ['a','b','c','d'],
url: "<a href="www.baidu.com">百度一下</a>",
myref: "https://localhost/springboot/test1",
fullName: 'aaaa'
},
methods: {
fun1: function(item,...array){
alert(this.message);
consolo.log(this.message);
}
},
computed: {
fullName: {
set: function(newValue){
this.fullName=newValue;
},
get: function(){
return fullName;
}
}
},
filter: {
numFilter:function(nums){
return nums+"$";
}
},
components:{
mycon:constructor,
},
mixins:[],
watch:{
属性名:{
deep:true,
immediate:true,
handler(newValue,oldValue){
}
}
},
derective:{
mubind:{
bind(element,binding){
element.value=binding.value;
},
inserted(element,binding){
element.focus();
},
update(element,binding){
element.value=bind.value;
}
}
},
})
<style>
[v-cloak]{
display:none;
}
</style>
<div id="app">
{
{message}}
<span v-for="(item,index) in array">{
{item}}</span>
<button v-on:click="alert('dddd')" />
<span v-once>{
{message}}</span>
<span v-html="url"></span>
<span v-text="message"></span>
<span v-cloak>{
{message}}</span>
<span v-pre></span>
<a v-bind:href="myref"></a>
<a :href="myref"></a>
<span v-bind:class="{classname1:boolean,classname2:boolean}"></span>
<span :class="['active','line']"></span>
<span :class="getclasses"></span>
<li v-for="(item,index) in movies" :style="{cursor:'pointer'}" :class="{red:index==choose}"
v-on:click="change(index)">{
{item}}</li>
<span :style="{key:'value'}"></span>
<input type="text" v-model="message" />
<input type="radio" v-model="chooce" />
<input type="radio" v-model="chooce" />
<input type="checkbox" value="2" v-model="choocearray" />
<input type="checkbox" value="1" v-model="choocearray" />
<select v-model=