diff --git a/projects/IoTCenter/wwwroot/css/app.css b/projects/IoTCenter/wwwroot/css/app.css new file mode 100644 index 00000000..46800d16 --- /dev/null +++ b/projects/IoTCenter/wwwroot/css/app.css @@ -0,0 +1,2 @@ +body { +} diff --git a/projects/IoTCenter/wwwroot/js/app.js b/projects/IoTCenter/wwwroot/js/app.js new file mode 100644 index 00000000..ed160529 --- /dev/null +++ b/projects/IoTCenter/wwwroot/js/app.js @@ -0,0 +1,47 @@ +var app; +Vue.component('page-not-found', { + template: '#page-not-found', + created: function () { + alert('404'); + } +}); +new Vue({ + // App Root Element + el: '#app', + + // App root data + data() { + return { + f7params: { + root: '#app', + theme: 'ios', + routes: [ + { + path: '/home/', + component: 'home' + }, + { + path: '/url1/', + component: 'foo' + }, + { + path: '/url2/', + component: 'bar' + }, + { + path: '(.*)', + component: 'page-not-found', + } + ] + } + }; + }, + mounted() { + this.$f7ready((f7) => { + app = this.$f7; + }); + }, + methods: { + + } +}); \ No newline at end of file diff --git a/projects/IoTCenter/wwwroot/test.c1.html b/projects/IoTCenter/wwwroot/test.c1.html index 0c9a3548..b8ae3917 100644 --- a/projects/IoTCenter/wwwroot/test.c1.html +++ b/projects/IoTCenter/wwwroot/test.c1.html @@ -1 +1,9 @@ -
foo {{count}}
\ No newline at end of file + \ No newline at end of file diff --git a/projects/IoTCenter/wwwroot/test.c1.js b/projects/IoTCenter/wwwroot/test.c1.js index e00e0b95..9068005c 100644 --- a/projects/IoTCenter/wwwroot/test.c1.js +++ b/projects/IoTCenter/wwwroot/test.c1.js @@ -1,15 +1,4 @@ -//const Foo = Vue.component('fool', { -// template: '
foo {{count}}
', -// data() { -// return { -// count: 123 -// }; -// }, -// created: function () { -// alert('created'); -// } -//}); -const Foo = Vue.component('fool', function (resolve, reject) { +Vue.component('foo', function (resolve, reject) { // 可以请求一个html文件,既然存放模板还是html文件存放比较好 $.get("./test.c1.html").then(function (res) { resolve({ @@ -20,7 +9,7 @@ const Foo = Vue.component('fool', function (resolve, reject) { }; }, created: function () { - alert('created'); + //alert('created'); } }) }); diff --git a/projects/IoTCenter/wwwroot/test.c2.html b/projects/IoTCenter/wwwroot/test.c2.html new file mode 100644 index 00000000..c6eda81f --- /dev/null +++ b/projects/IoTCenter/wwwroot/test.c2.html @@ -0,0 +1,9 @@ + \ No newline at end of file diff --git a/projects/IoTCenter/wwwroot/test.c2.js b/projects/IoTCenter/wwwroot/test.c2.js index b4276bb7..cb17d647 100644 --- a/projects/IoTCenter/wwwroot/test.c2.js +++ b/projects/IoTCenter/wwwroot/test.c2.js @@ -1 +1,16 @@ -const Bar = { template: '
bar
' } +Vue.component('bar', function (resolve, reject) { + // 可以请求一个html文件,既然存放模板还是html文件存放比较好 + $.get("./test.c2.html").then(function (res) { + resolve({ + template: res, + data() { + return { + count: 465 + }; + }, + created: function () { + //alert('created'); + } + }) + }); +}); \ No newline at end of file diff --git a/projects/IoTCenter/wwwroot/test.home.html b/projects/IoTCenter/wwwroot/test.home.html new file mode 100644 index 00000000..9a5b4d96 --- /dev/null +++ b/projects/IoTCenter/wwwroot/test.home.html @@ -0,0 +1,9 @@ + \ No newline at end of file diff --git a/projects/IoTCenter/wwwroot/test.home.js b/projects/IoTCenter/wwwroot/test.home.js new file mode 100644 index 00000000..48e30ca3 --- /dev/null +++ b/projects/IoTCenter/wwwroot/test.home.js @@ -0,0 +1,16 @@ +Vue.component('home', function (resolve, reject) { + // 可以请求一个html文件,既然存放模板还是html文件存放比较好 + $.get("./test.home.html").then(function (res) { + resolve({ + template: res, + data() { + return { + count: 123 + }; + }, + created: function () { + console.log('created'); + } + }) + }); +}); diff --git a/projects/IoTCenter/wwwroot/test.html b/projects/IoTCenter/wwwroot/test.html index 5f87eb3b..5ab79dd7 100644 --- a/projects/IoTCenter/wwwroot/test.html +++ b/projects/IoTCenter/wwwroot/test.html @@ -1,42 +1,40 @@  - - + + + + + +
-

Hello App!

-

- - - - Go to Foo - Go to Bar -

- - - + + + + +
+ + + - - + + + + \ No newline at end of file