home.page.js
1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
var Vue = require('yoho-vue');
var app = require('example/home.vue');
var tpl = require('example/hello.hbs');
var tip = require('../common/tip');
var vm = new Vue({
el: '#app',
components: {
app: app
}
});
console.log(vm);
/* eslint-disable */
// 私有包测试
var qs = require('yoho-qs');
console.log(qs);
var parse = require('yoho-qs/parse'); // 提供解析函数
console.log(parse('q=w&e=r')); // { q: 'w', e: 'r' }
var cookie = require('yoho-cookie');
console.log(cookie.all());
// ES6 test
var test = {
data() {
return {
message: 'test',
message2: 'test2'
};
}
};
// Handlebars/HBS 模版例子
$('#hbs-placeholder').html(tpl({
text: 'Handlerbars'
}));
/* --------------tip demo---------*/
var tipBtn = document.querySelector('#show-tip');
tipBtn.addEventListener('click', function(){
tip('中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中')
})
/* eslint-enable */