diff --git a/src/code/spin.js b/src/code/spin.js new file mode 100644 index 0000000..25e7b47 --- /dev/null +++ b/src/code/spin.js @@ -0,0 +1,84 @@ +let code = {}; + +code.import = ` +"usingComponents": { + "i-spin": "../../dist/spin/index" +} +`; +code.usage = ` +三种尺寸 + + + + + + + + + + + + + +居中固定 + + + + + +自定义内容 + + + + 加载中... + + + + + Loading + + + + + + + + + +切换显示状态 + + + 登金陵凤凰台 + 李白 + + 凤凰台上凤凰游,凤去台空江自流。 + 吴宫花草埋幽径,晋代衣冠成古丘。 + 三山半落青天外,二水中分白鹭洲。 + 总为浮云能蔽日,长安不见使人愁。 + + + + + + + + +`; + +code.js = ` +Page({ + data: { + spinShow: true, + switch: false + }, + onSwitchChange ({ detail }) { + const value = detail.value; + this.setData({ + switch: value, + spinShow: !value + }); + } +}); +`; + +export default code; \ No newline at end of file diff --git a/src/router.js b/src/router.js index ab24b7f..e061b47 100755 --- a/src/router.js +++ b/src/router.js @@ -149,6 +149,13 @@ const routers = [ }, component: (resolve) => require(['./views/components/message.vue'], resolve) }, + { + path: '/components/spin', + meta: { + title: '加载中 Spin' + }, + component: (resolve) => require(['./views/components/spin.vue'], resolve) + }, { path: '*', redirect: '/' diff --git a/src/views/components/spin.vue b/src/views/components/spin.vue new file mode 100644 index 0000000..a2f65f7 --- /dev/null +++ b/src/views/components/spin.vue @@ -0,0 +1,79 @@ + + \ No newline at end of file