first commit

This commit is contained in:
编码猿
2024-09-27 02:06:13 +08:00
commit 852d94fbb9
36760 changed files with 3274413 additions and 0 deletions

View File

@@ -0,0 +1,66 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<div class="app">
<h2 v-title="test">{{ test | filTest }}</h2>
</div>
</body>
<script src="https://cdn.jsdelivr.net/npm/vue@2.6.14"></script>
<script>
// 混入
// 官方提供的封装方案可以解决this指向的问题
var more = {
data () {
return {
page: 1,
totalPage: 0
}
},
methods: {
getMore() {
console.log("getMore", this.test);
}
}
};
new Vue({
el: '.app',
data: {
test: '你好你好你好你好你好你好你好'
},
created() {
console.log(this.page);
this.getMore()
},
mixins: [ more ],
methods: {
},
directives: {
title: {
bind(el,binding) {
document.title = binding.value
console.log("bind: ",el,binding);
},
inserted (el,binding) {
console.log("inserted: ",el,binding);
},
update(el,binding) {
}
}
},
filters: {
filTest(val) {
return val.substring(0,4) + '...'
}
}
})
</script>
</html>