diff --git a/src/code/tab-bar.js b/src/code/tab-bar.js new file mode 100644 index 0000000..d1f5264 --- /dev/null +++ b/src/code/tab-bar.js @@ -0,0 +1,43 @@ +let code = {}; + +code.import = ` +"usingComponents": { + "i-tab-bar": "../../dist/tab-bar/index", + "i-tab-bar-item": "../../dist/tab-bar-item/index" +} +`; +code.usage = ` +基本用法 + + + + + + + + +自定义主题色 + + + + + + + +`; + +code.js = ` +Page({ + data: { + current: 'homepage' + }, + + handleChange ({ detail }) { + this.setData({ + current: detail.key + }); + } +}); +`; + +export default code; \ No newline at end of file diff --git a/src/router.js b/src/router.js index 5e44637..a43dbd2 100755 --- a/src/router.js +++ b/src/router.js @@ -79,6 +79,13 @@ const routers = [ }, component: (resolve) => require(['./views/components/icon.vue'], resolve) }, + { + path: '/components/tab-bar', + meta: { + title: '标签栏 TabBar' + }, + component: (resolve) => require(['./views/components/tab-bar.vue'], resolve) + }, { path: '*', redirect: '/' diff --git a/src/views/components/tab-bar.vue b/src/views/components/tab-bar.vue new file mode 100644 index 0000000..8c0d4cf --- /dev/null +++ b/src/views/components/tab-bar.vue @@ -0,0 +1,151 @@ + + \ No newline at end of file