├── .eslintignore
├── .eslintrc.js
├── .gitignore
├── CONTRIBUTING.md
├── LICENSE
├── README.md
├── docs
├── advanced.md
├── develop.md
├── domextend.md
├── images
│ ├── 01.jpg
│ ├── 02.png
│ ├── 03.jpg
│ └── code1.jpg
├── miniprogram.config.js
├── principle.md
├── question.md
├── quickstart.md
└── tutorial.md
├── examples
├── README.md
├── demo1
│ ├── build
│ │ ├── miniprogram.config.js
│ │ ├── webpack.config.js
│ │ └── webpack.mp.config.js
│ ├── index.html
│ ├── package.json
│ └── src
│ │ ├── common
│ │ └── Footer.vue
│ │ └── index
│ │ ├── AAA.vue
│ │ ├── App.vue
│ │ ├── BBB.vue
│ │ ├── main.js
│ │ └── main.mp.js
├── demo10
│ ├── build
│ │ ├── miniprogram.config.js
│ │ └── webpack.mp.config.js
│ ├── package.json
│ └── src
│ │ ├── custom-components
│ │ ├── common
│ │ │ └── utils.js
│ │ ├── comp-a.js
│ │ ├── comp-a.json
│ │ ├── comp-a.wxml
│ │ ├── comp-a.wxss
│ │ ├── comp-b
│ │ │ ├── index.js
│ │ │ ├── index.json
│ │ │ ├── index.wxml
│ │ │ └── index.wxss
│ │ ├── comp-c.js
│ │ ├── comp-c.json
│ │ ├── comp-c.wxml
│ │ ├── comp-c.wxss
│ │ ├── comp-d.js
│ │ ├── comp-d.json
│ │ ├── comp-d.wxml
│ │ ├── comp-d.wxss
│ │ └── comp-e
│ │ │ ├── index.js
│ │ │ ├── index.json
│ │ │ ├── index.wxml
│ │ │ └── index.wxss
│ │ ├── index
│ │ ├── App.vue
│ │ └── main.mp.js
│ │ └── other
│ │ ├── App.vue
│ │ └── main.mp.js
├── demo11
│ ├── build
│ │ ├── miniprogram.config.js
│ │ └── webpack.mp.config.js
│ ├── package.json
│ └── src
│ │ ├── common
│ │ ├── Footer.vue
│ │ └── Header.vue
│ │ ├── custom-tab-bar
│ │ ├── index.js
│ │ ├── index.json
│ │ ├── index.wxml
│ │ └── index.wxss
│ │ ├── img
│ │ ├── page1-sel.png
│ │ ├── page1.png
│ │ ├── page2-sel.png
│ │ └── page2.png
│ │ ├── page1
│ │ ├── App.vue
│ │ └── main.mp.js
│ │ ├── page2
│ │ ├── App.vue
│ │ └── main.mp.js
│ │ └── page3
│ │ ├── App.vue
│ │ └── main.mp.js
├── demo12
│ ├── build
│ │ ├── miniprogram.config.js
│ │ └── webpack.mp.config.js
│ ├── index.html
│ ├── package.json
│ └── src
│ │ ├── common
│ │ └── Footer.vue
│ │ └── index
│ │ ├── AAA.vue
│ │ ├── App.vue
│ │ ├── BBB.vue
│ │ ├── main.js
│ │ └── main.mp.js
├── demo13
│ ├── build
│ │ ├── miniprogram.config.js
│ │ ├── webpack.config.js
│ │ └── webpack.mp.config.js
│ ├── index.html
│ ├── package.json
│ └── src
│ │ └── index
│ │ ├── main.js
│ │ ├── main.mp.js
│ │ └── todo.vue
├── demo14
│ ├── build
│ │ ├── miniprogram.config.js
│ │ ├── webpack.config.js
│ │ └── webpack.mp.config.js
│ ├── index.html
│ ├── package.json
│ └── src
│ │ ├── common
│ │ └── Footer.vue
│ │ └── index
│ │ ├── AAA.vue
│ │ ├── App.vue
│ │ ├── BBB.vue
│ │ ├── locales.json
│ │ ├── main.js
│ │ └── main.mp.js
├── demo15
│ ├── build
│ │ ├── miniprogram.config.js
│ │ ├── webpack.config.js
│ │ └── webpack.mp.config.js
│ ├── index.html
│ ├── package.json
│ └── src
│ │ └── index
│ │ ├── App.vue
│ │ ├── main.js
│ │ └── main.mp.js
├── demo16
│ ├── .babelrc
│ ├── build
│ │ ├── miniprogram.config.js
│ │ ├── webpack.config.js
│ │ └── webpack.mp.config.js
│ ├── index.html
│ ├── package.json
│ └── src
│ │ ├── app.css
│ │ ├── app.jsx
│ │ ├── fragment.jsx
│ │ ├── main.jsx
│ │ ├── main.mp.jsx
│ │ ├── picker-view.jsx
│ │ ├── view1.jsx
│ │ ├── view2.jsx
│ │ └── view3.jsx
├── demo17
│ ├── build
│ │ ├── miniprogram.config.js
│ │ ├── webpack.config.js
│ │ └── webpack.mp.config.js
│ ├── index.html
│ ├── package.json
│ └── src
│ │ ├── app.css
│ │ ├── app.jsx
│ │ ├── main.jsx
│ │ └── main.mp.jsx
├── demo18
│ ├── build
│ │ ├── miniprogram.config.js
│ │ └── webpack.mp.config.js
│ ├── package.json
│ └── src
│ │ ├── common
│ │ ├── Footer.vue
│ │ └── Header.vue
│ │ ├── page1
│ │ ├── App.vue
│ │ └── main.mp.js
│ │ ├── page2
│ │ ├── App.vue
│ │ └── main.mp.js
│ │ └── page3
│ │ ├── App.vue
│ │ └── main.mp.js
├── demo19
│ ├── build
│ │ ├── miniprogram.config.js
│ │ └── webpack.mp.config.js
│ ├── cloudfunctions
│ │ ├── callback
│ │ │ ├── config.json
│ │ │ ├── index.js
│ │ │ └── package.json
│ │ ├── echo
│ │ │ ├── config.json
│ │ │ ├── index.js
│ │ │ └── package.json
│ │ ├── login
│ │ │ ├── config.json
│ │ │ ├── index.js
│ │ │ └── package.json
│ │ └── openapi
│ │ │ ├── config.json
│ │ │ ├── index.js
│ │ │ └── package.json
│ ├── package.json
│ └── src
│ │ ├── app.css
│ │ ├── app.js
│ │ ├── chooselib
│ │ ├── App.vue
│ │ └── main.mp.js
│ │ ├── databaseguide
│ │ ├── App.vue
│ │ └── main.mp.js
│ │ ├── deployfunctions
│ │ ├── App.vue
│ │ └── main.mp.js
│ │ ├── images
│ │ ├── console-entrance.png
│ │ ├── create-collection.png
│ │ └── user-unlogin.png
│ │ ├── index
│ │ ├── App.vue
│ │ └── main.mp.js
│ │ ├── storageconsole
│ │ ├── App.vue
│ │ └── main.mp.js
│ │ ├── style
│ │ └── guide.less
│ │ └── userconsole
│ │ ├── App.vue
│ │ └── main.mp.js
├── demo2
│ ├── build
│ │ ├── miniprogram.config.js
│ │ ├── webpack.config.js
│ │ └── webpack.mp.config.js
│ ├── index.html
│ ├── package.json
│ └── src
│ │ ├── common
│ │ ├── Footer.vue
│ │ └── Header.vue
│ │ └── index
│ │ ├── App.vue
│ │ ├── main.js
│ │ ├── main.mp.js
│ │ ├── printf.js
│ │ └── web.js
├── demo20
│ ├── build
│ │ ├── miniprogram.config.js
│ │ └── webpack.mp.config.js
│ ├── package.json
│ └── src
│ │ ├── bar
│ │ ├── App.vue
│ │ └── main.mp.js
│ │ ├── boxplot
│ │ ├── App.vue
│ │ └── main.mp.js
│ │ ├── chart.js
│ │ ├── funnel
│ │ ├── App.vue
│ │ └── main.mp.js
│ │ ├── gauge
│ │ ├── App.vue
│ │ └── main.mp.js
│ │ ├── graph
│ │ ├── App.vue
│ │ └── main.mp.js
│ │ ├── heatmap
│ │ ├── App.vue
│ │ └── main.mp.js
│ │ ├── images
│ │ ├── bar.png
│ │ ├── boxplot.png
│ │ ├── custom.png
│ │ ├── funnel.png
│ │ ├── gauge.png
│ │ ├── graph.png
│ │ ├── heatmap.png
│ │ ├── k.png
│ │ ├── line.png
│ │ ├── map.png
│ │ ├── parallel.png
│ │ ├── pictorialbar.png
│ │ ├── pie.png
│ │ ├── radar.png
│ │ ├── sankey.png
│ │ ├── scatter.png
│ │ ├── sunburst.png
│ │ ├── themeRiver.png
│ │ ├── tree.png
│ │ └── treemap.png
│ │ ├── index
│ │ ├── App.vue
│ │ └── main.mp.js
│ │ ├── k
│ │ ├── App.vue
│ │ └── main.mp.js
│ │ ├── line
│ │ ├── App.vue
│ │ └── main.mp.js
│ │ ├── map
│ │ ├── App.vue
│ │ ├── main.mp.js
│ │ └── mapData.js
│ │ ├── parallel
│ │ ├── App.vue
│ │ └── main.mp.js
│ │ ├── pie
│ │ ├── App.vue
│ │ └── main.mp.js
│ │ ├── radar
│ │ ├── App.vue
│ │ └── main.mp.js
│ │ ├── sankey
│ │ ├── App.vue
│ │ └── main.mp.js
│ │ ├── scatter
│ │ ├── App.vue
│ │ └── main.mp.js
│ │ ├── sunburst
│ │ ├── App.vue
│ │ └── main.mp.js
│ │ ├── themeriver
│ │ ├── App.vue
│ │ └── main.mp.js
│ │ ├── tree
│ │ ├── App.vue
│ │ └── main.mp.js
│ │ └── treemap
│ │ ├── App.vue
│ │ └── main.mp.js
├── demo21
│ ├── build
│ │ ├── miniprogram.config.js
│ │ └── webpack.mp.config.js
│ ├── mp
│ │ ├── app.js
│ │ ├── app.json
│ │ ├── app.wxss
│ │ ├── package.json
│ │ ├── pages
│ │ │ └── index
│ │ │ │ ├── index.js
│ │ │ │ ├── index.json
│ │ │ │ ├── index.wxml
│ │ │ │ └── index.wxss
│ │ ├── project.config.json
│ │ ├── sitemap.json
│ │ └── utils
│ │ │ └── util.js
│ ├── package.json
│ └── src
│ │ ├── common
│ │ ├── Footer.vue
│ │ └── Header.vue
│ │ ├── page1
│ │ ├── App.vue
│ │ └── main.mp.js
│ │ └── page2
│ │ ├── App.vue
│ │ └── main.mp.js
├── demo22
│ ├── build
│ │ ├── miniprogram.config.js
│ │ └── webpack.mp.config.js
│ ├── package.json
│ └── src
│ │ ├── common
│ │ ├── Footer.vue
│ │ ├── Header.vue
│ │ └── Storage.vue
│ │ ├── page1
│ │ ├── App.vue
│ │ └── main.mp.js
│ │ ├── page2
│ │ ├── App.vue
│ │ └── main.mp.js
│ │ ├── page3
│ │ ├── App.vue
│ │ └── main.mp.js
│ │ ├── page4
│ │ ├── App.vue
│ │ └── main.mp.js
│ │ └── store
│ │ └── index.js
├── demo23
│ ├── build
│ │ ├── miniprogram.config.js
│ │ └── webpack.mp.config.js
│ ├── package.json
│ └── src
│ │ ├── common
│ │ └── Footer.vue
│ │ └── index
│ │ ├── AAA.vue
│ │ ├── App.vue
│ │ ├── BBB.vue
│ │ ├── CCC.vue
│ │ └── main.mp.js
├── demo24
│ ├── .babelrc
│ ├── build
│ │ ├── miniprogram.config.js
│ │ ├── webpack.config.js
│ │ └── webpack.mp.config.js
│ ├── index.html
│ ├── package.json
│ └── src
│ │ ├── common
│ │ ├── Footer.css
│ │ ├── Footer.jsx
│ │ ├── Header.css
│ │ └── Header.jsx
│ │ ├── page1
│ │ ├── App.css
│ │ ├── App.jsx
│ │ ├── main.jsx
│ │ └── main.mp.jsx
│ │ ├── page2
│ │ ├── App.css
│ │ ├── App.jsx
│ │ ├── main.jsx
│ │ └── main.mp.jsx
│ │ └── page3
│ │ ├── App.css
│ │ ├── App.jsx
│ │ ├── main.jsx
│ │ └── main.mp.jsx
├── demo25
│ ├── build
│ │ ├── miniprogram.config.js
│ │ ├── webpack.config.js
│ │ └── webpack.mp.config.js
│ ├── index.html
│ ├── package.json
│ └── src
│ │ ├── common
│ │ ├── Footer.vue
│ │ └── Header.vue
│ │ ├── page1
│ │ ├── App.vue
│ │ ├── main.js
│ │ └── main.mp.js
│ │ ├── page2
│ │ ├── App.vue
│ │ ├── main.js
│ │ └── main.mp.js
│ │ ├── page3
│ │ ├── App.vue
│ │ ├── main.js
│ │ └── main.mp.js
│ │ └── worker
│ │ ├── sharedWorker.js
│ │ └── worker.js
├── demo26
│ ├── build
│ │ ├── miniprogram.config.js
│ │ └── webpack.mp.config.js
│ ├── package.json
│ └── src
│ │ ├── common
│ │ ├── Footer.vue
│ │ └── Header.vue
│ │ ├── page1
│ │ ├── App.vue
│ │ └── main.mp.js
│ │ ├── page2
│ │ ├── App.vue
│ │ └── main.mp.js
│ │ └── page3
│ │ ├── App.vue
│ │ └── main.mp.js
├── demo27
│ ├── build
│ │ ├── miniprogram.config.js
│ │ ├── webpack.config.js
│ │ └── webpack.mp.config.js
│ ├── index.html
│ ├── package.json
│ └── src
│ │ └── index
│ │ ├── App.vue
│ │ ├── Inner.vue
│ │ ├── main.js
│ │ └── main.mp.js
├── demo28
│ ├── build
│ │ ├── miniprogram.config.js
│ │ ├── webpack.config.js
│ │ └── webpack.mp.config.js
│ ├── index.html
│ ├── package.json
│ └── src
│ │ └── index
│ │ ├── App.vue
│ │ ├── main.js
│ │ └── main.mp.js
├── demo29
│ ├── build
│ │ ├── miniprogram.config.js
│ │ └── webpack.mp.config.js
│ ├── index.html
│ ├── package.json
│ └── src
│ │ ├── common
│ │ └── Footer.vue
│ │ └── index
│ │ ├── App.vue
│ │ └── main.mp.js
├── demo3
│ ├── build
│ │ ├── miniprogram.config.js
│ │ └── webpack.mp.config.js
│ ├── index.html
│ ├── package.json
│ └── src
│ │ ├── index
│ │ ├── App.vue
│ │ ├── Component.vue
│ │ ├── CustomCallout.vue
│ │ ├── Inner.vue
│ │ ├── Inner2.vue
│ │ ├── imgs
│ │ │ ├── location.png
│ │ │ └── voice.png
│ │ └── main.mp.js
│ │ ├── loading-view
│ │ ├── loading.js
│ │ ├── loading.json
│ │ ├── loading.wxml
│ │ └── loading.wxss
│ │ └── page-container
│ │ ├── App.vue
│ │ └── main.mp.js
├── demo30
│ ├── build
│ │ ├── miniprogram.config.js
│ │ └── webpack.mp.config.js
│ ├── package.json
│ └── src
│ │ ├── common
│ │ ├── Footer.vue
│ │ └── Header.vue
│ │ ├── page1
│ │ ├── App.vue
│ │ └── main.mp.js
│ │ ├── page2
│ │ ├── App.vue
│ │ └── main.mp.js
│ │ └── page3
│ │ ├── App.vue
│ │ └── main.mp.js
├── demo31
│ ├── build
│ │ ├── miniprogram.config.js
│ │ └── webpack.mp.config.js
│ ├── package.json
│ └── src
│ │ ├── body.html
│ │ ├── index.css
│ │ ├── index.mp.js
│ │ └── jquery-3.6.0.js
├── demo32
│ ├── build
│ │ ├── miniprogram.config.js
│ │ └── webpack.mp.config.js
│ ├── mp
│ │ ├── app.js
│ │ ├── app.json
│ │ ├── app.wxss
│ │ ├── img
│ │ │ ├── page-sel.png
│ │ │ └── page.png
│ │ ├── kbone
│ │ │ ├── common
│ │ │ │ ├── default~page2~page3~page4.js
│ │ │ │ ├── default~page2~page3~page4.wxss
│ │ │ │ └── vendors~page2~page3~page4.js
│ │ │ ├── package.json
│ │ │ ├── package1
│ │ │ │ ├── common
│ │ │ │ │ ├── page2.js
│ │ │ │ │ └── page2.wxss
│ │ │ │ ├── config.js
│ │ │ │ └── pages
│ │ │ │ │ ├── base.js
│ │ │ │ │ └── page2
│ │ │ │ │ ├── index.js
│ │ │ │ │ ├── index.json
│ │ │ │ │ ├── index.wxml
│ │ │ │ │ └── index.wxss
│ │ │ └── package2
│ │ │ │ ├── common
│ │ │ │ ├── page3.js
│ │ │ │ ├── page3.wxss
│ │ │ │ ├── page4.js
│ │ │ │ ├── page4.wxss
│ │ │ │ └── vendors~page4.js
│ │ │ │ ├── config.js
│ │ │ │ └── pages
│ │ │ │ ├── base.js
│ │ │ │ ├── page3
│ │ │ │ ├── index.js
│ │ │ │ ├── index.json
│ │ │ │ ├── index.wxml
│ │ │ │ └── index.wxss
│ │ │ │ └── page4
│ │ │ │ ├── index.js
│ │ │ │ ├── index.json
│ │ │ │ ├── index.wxml
│ │ │ │ └── index.wxss
│ │ ├── package.json
│ │ ├── pages
│ │ │ ├── index
│ │ │ │ ├── index.js
│ │ │ │ ├── index.json
│ │ │ │ ├── index.wxml
│ │ │ │ └── index.wxss
│ │ │ ├── index2
│ │ │ │ ├── index.js
│ │ │ │ ├── index.json
│ │ │ │ ├── index.wxml
│ │ │ │ └── index.wxss
│ │ │ ├── index3
│ │ │ │ ├── index.js
│ │ │ │ ├── index.json
│ │ │ │ ├── index.wxml
│ │ │ │ └── index.wxss
│ │ │ └── index4
│ │ │ │ ├── index.js
│ │ │ │ ├── index.json
│ │ │ │ ├── index.wxml
│ │ │ │ └── index.wxss
│ │ ├── project.config.json
│ │ ├── sitemap.json
│ │ └── utils
│ │ │ └── util.js
│ ├── package.json
│ └── src
│ │ ├── app.css
│ │ ├── app.js
│ │ ├── common
│ │ ├── Footer.vue
│ │ └── Header.vue
│ │ ├── page2
│ │ ├── App.vue
│ │ └── main.mp.js
│ │ ├── page3
│ │ ├── App.vue
│ │ └── main.mp.js
│ │ └── page4
│ │ ├── App.vue
│ │ ├── components
│ │ ├── AAA.vue
│ │ ├── BBB.vue
│ │ ├── Layout.vue
│ │ └── Normal.vue
│ │ └── main.mp.js
├── demo33
│ ├── build
│ │ ├── miniprogram.config.js
│ │ ├── mp
│ │ │ └── OrbitControls.js
│ │ ├── webpack.config.js
│ │ └── webpack.mp.config.js
│ ├── index.html
│ ├── package.json
│ ├── res
│ │ ├── negx.jpg
│ │ ├── negy.jpg
│ │ ├── negz.jpg
│ │ ├── posx.jpg
│ │ ├── posy.jpg
│ │ ├── posz.jpg
│ │ └── total360.jpg
│ └── src
│ │ ├── index
│ │ ├── App.vue
│ │ ├── main.js
│ │ └── main.mp.js
│ │ └── index2
│ │ ├── App.vue
│ │ ├── main.js
│ │ └── main.mp.js
├── demo34
│ ├── .babelrc
│ ├── build
│ │ ├── miniprogram.config.js
│ │ └── webpack.mp.config.js
│ ├── package.json
│ └── src
│ │ ├── custom-components
│ │ ├── common
│ │ │ └── utils.js
│ │ ├── comp-a.js
│ │ ├── comp-a.json
│ │ ├── comp-a.wxml
│ │ ├── comp-a.wxss
│ │ ├── comp-b
│ │ │ ├── index.js
│ │ │ ├── index.json
│ │ │ ├── index.wxml
│ │ │ └── index.wxss
│ │ ├── comp-c.js
│ │ ├── comp-c.json
│ │ ├── comp-c.wxml
│ │ ├── comp-c.wxss
│ │ ├── comp-d.js
│ │ ├── comp-d.json
│ │ ├── comp-d.wxml
│ │ ├── comp-d.wxss
│ │ └── comp-e
│ │ │ ├── index.js
│ │ │ ├── index.json
│ │ │ ├── index.wxml
│ │ │ └── index.wxss
│ │ ├── index
│ │ ├── App.css
│ │ ├── App.jsx
│ │ └── main.mp.jsx
│ │ └── other
│ │ ├── App.css
│ │ ├── App.jsx
│ │ └── main.mp.jsx
├── demo35
│ ├── build
│ │ ├── miniprogram.config.js
│ │ └── webpack.mp.config.js
│ ├── package.json
│ └── src
│ │ ├── common
│ │ ├── Footer.vue
│ │ └── Header.vue
│ │ ├── page1
│ │ ├── App.vue
│ │ └── main.mp.js
│ │ ├── page2
│ │ ├── App.vue
│ │ └── main.mp.js
│ │ └── page3
│ │ ├── App.vue
│ │ └── main.mp.js
├── demo4
│ ├── babel.config.js
│ ├── dev.md
│ ├── miniprogram.config.js
│ ├── package.json
│ ├── public
│ │ ├── favicon.ico
│ │ └── index.html
│ ├── src
│ │ ├── common
│ │ │ ├── Footer.vue
│ │ │ ├── Header.vue
│ │ │ └── utils.js
│ │ ├── page1
│ │ │ ├── App.vue
│ │ │ ├── main.js
│ │ │ └── main.mp.js
│ │ ├── page2
│ │ │ ├── App.vue
│ │ │ ├── main.js
│ │ │ └── main.mp.js
│ │ └── page3
│ │ │ ├── App.vue
│ │ │ ├── main.js
│ │ │ └── main.mp.js
│ └── vue.config.js
├── demo5
│ ├── build
│ │ ├── miniprogram.config.js
│ │ └── webpack.mp.config.js
│ ├── package.json
│ └── src
│ │ ├── app.css
│ │ ├── app.js
│ │ ├── common
│ │ ├── Footer.vue
│ │ ├── Header.vue
│ │ └── utils.js
│ │ ├── page1
│ │ ├── App.vue
│ │ └── main.mp.js
│ │ ├── page2
│ │ ├── App.vue
│ │ └── main.mp.js
│ │ ├── page3
│ │ ├── App.vue
│ │ └── main.mp.js
│ │ ├── page4
│ │ ├── App.vue
│ │ ├── components
│ │ │ ├── AAA.vue
│ │ │ ├── BBB.vue
│ │ │ ├── Layout.vue
│ │ │ └── Normal.vue
│ │ └── main.mp.js
│ │ └── page5
│ │ ├── App.vue
│ │ └── main.mp.js
├── demo6
│ ├── build
│ │ ├── miniprogram.config.js
│ │ ├── webpack.config.js
│ │ └── webpack.mp.config.js
│ ├── index.html
│ ├── package.json
│ └── src
│ │ ├── components
│ │ ├── todo-footer
│ │ │ ├── index.css
│ │ │ └── index.js
│ │ └── todo
│ │ │ ├── _index.css
│ │ │ └── index.js
│ │ ├── main.js
│ │ ├── main.mp.js
│ │ └── store.js
├── demo7
│ ├── build
│ │ ├── miniprogram.config.js
│ │ └── webpack.mp.config.js
│ ├── package.json
│ └── src
│ │ ├── common
│ │ ├── Footer.vue
│ │ └── Header.vue
│ │ ├── page1
│ │ ├── App.vue
│ │ └── main.mp.js
│ │ ├── page2
│ │ ├── App.vue
│ │ └── main.mp.js
│ │ ├── page3
│ │ ├── App.vue
│ │ └── main.mp.js
│ │ └── page4
│ │ ├── App.vue
│ │ └── main.mp.js
├── demo8
│ ├── build
│ │ ├── miniprogram.config.js
│ │ └── webpack.mp.config.js
│ ├── package.json
│ └── src
│ │ ├── assets
│ │ └── index.css
│ │ ├── components
│ │ ├── game
│ │ │ ├── _index.css
│ │ │ └── index.js
│ │ └── index
│ │ │ ├── _index.css
│ │ │ └── index.js
│ │ ├── main.mp.js
│ │ ├── models
│ │ ├── game.js
│ │ └── snake.js
│ │ └── stores
│ │ └── index.js
├── demo9
│ ├── build
│ │ ├── miniprogram.config.js
│ │ └── webpack.mp.config.js
│ ├── package.json
│ └── src
│ │ ├── common
│ │ ├── Footer.vue
│ │ └── Header.vue
│ │ ├── img
│ │ ├── page1-sel.png
│ │ ├── page1.png
│ │ ├── page2-sel.png
│ │ └── page2.png
│ │ ├── page1
│ │ ├── App.vue
│ │ └── main.mp.js
│ │ ├── page2
│ │ ├── App.vue
│ │ └── main.mp.js
│ │ └── page3
│ │ ├── App.vue
│ │ └── main.mp.js
├── kbone-cloud
│ ├── README.md
│ ├── build
│ │ ├── miniprogram.config.js
│ │ ├── webpack.config.js
│ │ └── webpack.mp.config.js
│ ├── cloudfunctions
│ │ ├── add
│ │ │ ├── config.json
│ │ │ ├── index.js
│ │ │ └── package.json
│ │ └── get
│ │ │ ├── config.json
│ │ │ ├── index.js
│ │ │ └── package.json
│ ├── index.html
│ ├── package.json
│ └── src
│ │ ├── App.vue
│ │ ├── common
│ │ └── list.vue
│ │ ├── main.js
│ │ └── main.mp.js
└── tips.md
├── lerna.json
├── package-lock.json
├── package.json
└── packages
├── file-wrapper-loader
├── .npmignore
├── CHANGELOG.md
├── README.md
├── package.json
└── src
│ └── index.js
├── html-to-js-loader
├── .npmignore
├── CHANGELOG.md
├── README.md
├── package.json
├── src
│ ├── index.js
│ └── parser.js
└── test
│ └── index.test.js
├── kbone-cli
├── .eslintrc
├── .npmignore
├── CHANGELOG.md
├── README.md
├── bin
│ └── kbone-cli
├── package.json
└── src
│ ├── init-template.js
│ ├── init.js
│ ├── install.js
│ ├── logger.js
│ ├── mirror.json
│ └── utils.js
├── kbone-tool
├── .npmignore
├── CHANGELOG.md
├── README.md
├── dist
│ └── index.min.js
├── package.json
├── src
│ ├── index.js
│ ├── jquery.js
│ ├── tool.js
│ ├── vue.js
│ └── weui.js
├── test
│ └── vue.test.js
└── webpack.config.js
├── kbone-ui
├── .babelrc
├── .eslintrc.js
├── .npmignore
├── .stylelintrc.js
├── CHANGELOG.md
├── README.md
├── dist
│ ├── index.dev.js
│ ├── index.js
│ ├── wx-components.dev.js
│ └── wx-components.js
├── index.js
├── package.json
├── src
│ ├── components
│ │ ├── base.js
│ │ ├── hover.js
│ │ ├── scroller.js
│ │ ├── wx-animation
│ │ │ ├── index.html
│ │ │ ├── index.js
│ │ │ └── index.less
│ │ ├── wx-button
│ │ │ ├── index.html
│ │ │ ├── index.js
│ │ │ └── index.less
│ │ ├── wx-canvas
│ │ │ ├── index.html
│ │ │ ├── index.js
│ │ │ └── index.less
│ │ ├── wx-capture
│ │ │ ├── index.html
│ │ │ ├── index.js
│ │ │ └── index.less
│ │ ├── wx-catch
│ │ │ ├── index.html
│ │ │ ├── index.js
│ │ │ └── index.less
│ │ ├── wx-checkbox-group
│ │ │ ├── index.html
│ │ │ ├── index.js
│ │ │ └── index.less
│ │ ├── wx-checkbox
│ │ │ ├── index.html
│ │ │ ├── index.js
│ │ │ └── index.less
│ │ ├── wx-form
│ │ │ ├── index.html
│ │ │ ├── index.js
│ │ │ └── index.less
│ │ ├── wx-icon
│ │ │ ├── font.less
│ │ │ ├── index.html
│ │ │ ├── index.js
│ │ │ └── index.less
│ │ ├── wx-image
│ │ │ ├── index.html
│ │ │ ├── index.js
│ │ │ └── index.less
│ │ ├── wx-input
│ │ │ ├── index.html
│ │ │ ├── index.js
│ │ │ └── index.less
│ │ ├── wx-label
│ │ │ ├── index.html
│ │ │ ├── index.js
│ │ │ └── index.less
│ │ ├── wx-match-media
│ │ │ ├── index.html
│ │ │ ├── index.js
│ │ │ └── index.less
│ │ ├── wx-movable-area
│ │ │ ├── index.html
│ │ │ ├── index.js
│ │ │ └── index.less
│ │ ├── wx-movable-view
│ │ │ ├── index.html
│ │ │ ├── index.js
│ │ │ └── index.less
│ │ ├── wx-picker-view-column
│ │ │ ├── index.html
│ │ │ ├── index.js
│ │ │ └── index.less
│ │ ├── wx-picker-view
│ │ │ ├── index.html
│ │ │ ├── index.js
│ │ │ └── index.less
│ │ ├── wx-picker
│ │ │ ├── dialog.html
│ │ │ ├── dialog.less
│ │ │ ├── index.html
│ │ │ ├── index.js
│ │ │ ├── index.less
│ │ │ └── region.json
│ │ ├── wx-progress
│ │ │ ├── index.html
│ │ │ ├── index.js
│ │ │ └── index.less
│ │ ├── wx-radio-group
│ │ │ ├── index.html
│ │ │ ├── index.js
│ │ │ └── index.less
│ │ ├── wx-radio
│ │ │ ├── index.html
│ │ │ ├── index.js
│ │ │ └── index.less
│ │ ├── wx-rich-text
│ │ │ ├── index.html
│ │ │ ├── index.js
│ │ │ └── index.less
│ │ ├── wx-scroll-view
│ │ │ ├── index.html
│ │ │ ├── index.js
│ │ │ └── index.less
│ │ ├── wx-slider
│ │ │ ├── index.html
│ │ │ ├── index.js
│ │ │ └── index.less
│ │ ├── wx-swiper-item
│ │ │ ├── index.html
│ │ │ ├── index.js
│ │ │ └── index.less
│ │ ├── wx-swiper
│ │ │ ├── index.html
│ │ │ ├── index.js
│ │ │ └── index.less
│ │ ├── wx-switch
│ │ │ ├── index.html
│ │ │ ├── index.js
│ │ │ └── index.less
│ │ ├── wx-text
│ │ │ ├── index.html
│ │ │ ├── index.js
│ │ │ └── index.less
│ │ ├── wx-textarea
│ │ │ ├── index.html
│ │ │ ├── index.js
│ │ │ └── index.less
│ │ └── wx-view
│ │ │ ├── index.html
│ │ │ ├── index.js
│ │ │ └── index.less
│ ├── index.js
│ ├── inner-components
│ │ └── wx-refresher
│ │ │ ├── index.html
│ │ │ ├── index.js
│ │ │ ├── index.less
│ │ │ └── refresher.js
│ ├── register.js
│ ├── styles
│ │ ├── mixin.less
│ │ ├── mixin
│ │ │ ├── mobile.less
│ │ │ ├── setArrow.less
│ │ │ ├── setOnepx.less
│ │ │ └── text.less
│ │ ├── variable.less
│ │ ├── variable
│ │ │ ├── button.less
│ │ │ ├── cell.less
│ │ │ ├── color.less
│ │ │ ├── dialog.less
│ │ │ ├── global.less
│ │ │ ├── grid.less
│ │ │ ├── hover.less
│ │ │ ├── msg.less
│ │ │ └── progress.less
│ │ ├── weui-msg.less
│ │ └── weui.less
│ ├── utils
│ │ ├── animation-spring.js
│ │ ├── dom-extend.js
│ │ ├── html-filter.js
│ │ ├── html-parser.js
│ │ ├── polyfill.js
│ │ └── tool.js
│ ├── weui-components
│ │ ├── mp-actionsheet
│ │ │ ├── index.html
│ │ │ ├── index.js
│ │ │ └── index.less
│ │ ├── mp-badge
│ │ │ ├── index.html
│ │ │ ├── index.js
│ │ │ └── index.less
│ │ ├── mp-cell
│ │ │ ├── index.html
│ │ │ ├── index.js
│ │ │ └── index.less
│ │ ├── mp-cells
│ │ │ ├── index.html
│ │ │ ├── index.js
│ │ │ └── index.less
│ │ ├── mp-checkbox-group
│ │ │ ├── index.html
│ │ │ ├── index.js
│ │ │ └── index.less
│ │ ├── mp-checkbox
│ │ │ ├── index.html
│ │ │ ├── index.js
│ │ │ └── index.less
│ │ ├── mp-dialog
│ │ │ ├── index.html
│ │ │ ├── index.js
│ │ │ └── index.less
│ │ ├── mp-form-page
│ │ │ ├── index.html
│ │ │ ├── index.js
│ │ │ └── index.less
│ │ ├── mp-form
│ │ │ ├── form-validator.js
│ │ │ ├── index.html
│ │ │ ├── index.js
│ │ │ ├── index.less
│ │ │ └── validator.js
│ │ ├── mp-gallery
│ │ │ ├── index.html
│ │ │ ├── index.js
│ │ │ └── index.less
│ │ ├── mp-grids
│ │ │ ├── index.html
│ │ │ ├── index.js
│ │ │ └── index.less
│ │ ├── mp-half-screen-dialog
│ │ │ ├── index.html
│ │ │ ├── index.js
│ │ │ └── index.less
│ │ ├── mp-icon
│ │ │ ├── base64.js
│ │ │ ├── icondata.json
│ │ │ ├── index.html
│ │ │ ├── index.js
│ │ │ └── index.less
│ │ ├── mp-loading
│ │ │ ├── index.html
│ │ │ ├── index.js
│ │ │ └── index.less
│ │ ├── mp-msg
│ │ │ ├── index.html
│ │ │ ├── index.js
│ │ │ └── index.less
│ │ ├── mp-navigation-bar
│ │ │ ├── index.html
│ │ │ ├── index.js
│ │ │ └── index.less
│ │ ├── mp-searchbar
│ │ │ ├── index.html
│ │ │ ├── index.js
│ │ │ └── index.less
│ │ ├── mp-slideview
│ │ │ ├── index.html
│ │ │ ├── index.js
│ │ │ └── index.less
│ │ ├── mp-tabbar
│ │ │ ├── index.html
│ │ │ ├── index.js
│ │ │ └── index.less
│ │ ├── mp-toptips
│ │ │ ├── index.html
│ │ │ ├── index.js
│ │ │ └── index.less
│ │ ├── mp-uploader
│ │ │ ├── index.html
│ │ │ ├── index.js
│ │ │ └── index.less
│ │ └── weui-base.js
│ └── wx-components.js
├── tool
│ └── webpack.config.js
└── wx-components.js
├── miniprogram-element
├── .npmignore
├── CHANGELOG.md
├── README.md
├── dist
│ ├── base.js
│ ├── base.js.map
│ ├── custom-component
│ │ ├── index.js
│ │ ├── index.json
│ │ ├── index.wxml
│ │ └── index.wxss
│ ├── index-vhost.js
│ ├── index-vhost.json
│ ├── index-vhost.wxml
│ ├── index-vhost.wxss
│ ├── index.js
│ ├── index.json
│ ├── index.wxml
│ ├── index.wxss
│ └── template
│ │ ├── inner-component.wxml
│ │ ├── subtree-cover.wxml
│ │ └── subtree.wxml
├── package.json
├── src
│ ├── base.js
│ ├── custom-component
│ │ ├── index.js
│ │ ├── index.json
│ │ ├── index.wxml
│ │ └── index.wxss
│ ├── extra-props.js
│ ├── index-vhost.js
│ ├── index-vhost.json
│ ├── index-vhost.wxml
│ ├── index-vhost.wxss
│ ├── index.js
│ ├── index.json
│ ├── index.wxml
│ ├── index.wxss
│ ├── template
│ │ ├── inner-component.wxml
│ │ ├── subtree-cover.wxml
│ │ └── subtree.wxml
│ └── util
│ │ ├── component.js
│ │ └── tool.js
├── test
│ ├── ad-custom.test.js
│ ├── ad.test.js
│ ├── button.test.js
│ ├── camera.test.js
│ ├── canvas.test.js
│ ├── channel-live.test.js
│ ├── channel-video.test.js
│ ├── cover-image.test.js
│ ├── cover-view.test.js
│ ├── editor.test.js
│ ├── form.test.js
│ ├── icon.test.js
│ ├── image.test.js
│ ├── index.test.js
│ ├── input.test.js
│ ├── live-player.test.js
│ ├── live-pusher.test.js
│ ├── map.test.js
│ ├── match-media.test.js
│ ├── movable-area.test.js
│ ├── navigator.test.js
│ ├── official-account.test.js
│ ├── open-data.test.js
│ ├── page-container.test.js
│ ├── picker-view.test.js
│ ├── picker.test.js
│ ├── progress.test.js
│ ├── rich-text.test.js
│ ├── scroll-view.test.js
│ ├── slider.test.js
│ ├── store-home.test.js
│ ├── store-product.test.js
│ ├── swiper.test.js
│ ├── switch.test.js
│ ├── text.test.js
│ ├── textarea.test.js
│ ├── tool.test.js
│ ├── utils.js
│ ├── video.test.js
│ ├── view.test.js
│ ├── voip-room.test.js
│ └── web-view.test.js
└── tool
│ ├── index.js
│ ├── index.wxml
│ ├── inner-component.wxml
│ └── webpack.config.js
├── miniprogram-render
├── .npmignore
├── CHANGELOG.md
├── README.md
├── dist
│ ├── index.js
│ └── index.js.map
├── package.json
├── src
│ ├── bom
│ │ ├── cookie.js
│ │ ├── history.js
│ │ ├── location.js
│ │ ├── miniprogram.js
│ │ ├── navigator.js
│ │ ├── performance.js
│ │ ├── screen.js
│ │ ├── storage.js
│ │ ├── worker.js
│ │ └── xml-http-request.js
│ ├── document.js
│ ├── event
│ │ ├── custom-event.js
│ │ ├── event-target.js
│ │ └── event.js
│ ├── index.js
│ ├── node
│ │ ├── attribute.js
│ │ ├── class-list.js
│ │ ├── comment.js
│ │ ├── element.js
│ │ ├── element
│ │ │ ├── a.js
│ │ │ ├── canvas.js
│ │ │ ├── image.js
│ │ │ ├── input.js
│ │ │ ├── not-support.js
│ │ │ ├── option.js
│ │ │ ├── select.js
│ │ │ ├── textarea.js
│ │ │ ├── video.js
│ │ │ ├── wx-component.js
│ │ │ └── wx-custom-component.js
│ │ ├── node.js
│ │ ├── style-list.js
│ │ ├── style.js
│ │ └── text-node.js
│ ├── tree
│ │ ├── parser.js
│ │ ├── query-selector.js
│ │ └── tree.js
│ ├── util
│ │ ├── cache.js
│ │ ├── pool.js
│ │ └── tool.js
│ └── window.js
├── test
│ ├── bom
│ │ ├── cookie.test.js
│ │ ├── history.test.js
│ │ ├── location.test.js
│ │ ├── navigator.test.js
│ │ ├── performance.test.js
│ │ ├── screen.test.js
│ │ ├── storage.test.js
│ │ ├── worker.test.js
│ │ └── xml-http-request.test.js
│ ├── document.test.js
│ ├── event
│ │ └── event.test.js
│ ├── mock.js
│ ├── node
│ │ ├── class-list.test.js
│ │ ├── comment.test.js
│ │ ├── element.test.js
│ │ ├── element
│ │ │ └── image.test.js
│ │ ├── node.test.js
│ │ ├── style.test.js
│ │ └── text-node.test.js
│ ├── tree
│ │ ├── parser.test.js
│ │ └── query-selector.test.js
│ ├── util
│ │ └── tool.test.js
│ └── window.test.js
└── tool
│ ├── index.js
│ └── webpack.config.js
├── mp-webpack-plugin
├── .eslintrc.js
├── .npmignore
├── CHANGELOG.md
├── README.md
├── package.json
└── src
│ ├── index.js
│ ├── tmpl
│ ├── app.display.tmpl.wxss
│ ├── app.extra.tmpl.wxss
│ ├── app.tmpl.js
│ ├── app.tmpl.wxss
│ ├── custom-component.tmpl.js
│ ├── package.tmpl.json
│ ├── page.base.tmpl.js
│ ├── page.tmpl.js
│ ├── project.config.tmpl.json
│ └── worker.tmpl.js
│ └── tool
│ ├── adjust-css.js
│ ├── tag-list.js
│ ├── utils.js
│ └── weui-list.js
├── reduce-loader
├── .npmignore
├── CHANGELOG.md
├── README.md
├── package.json
└── src
│ └── index.js
├── replace-global-var-loader
├── .npmignore
├── CHANGELOG.md
├── README.md
├── package.json
├── src
│ └── index.js
└── test
│ └── index.test.js
├── vue-cli-plugin-kbone
├── .npmignore
├── CHANGELOG.md
├── README.md
├── generator.js
├── index.js
├── package.json
├── prompts.js
└── src
│ ├── defaultOptions.js
│ ├── generator.js
│ ├── index.js
│ ├── prompts.js
│ └── template
│ └── miniprogram.config.js
└── vue-improve-loader
├── .npmignore
├── CHANGELOG.md
├── README.md
├── package.json
├── src
├── index.js
└── parser.js
└── test
└── index.test.js
/.eslintignore:
--------------------------------------------------------------------------------
1 | packages/vue-cli-plugin-kbone/src/template/*
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .idea
2 | .DS_Store
3 | yarn.lock
4 | package-lock.json
5 |
6 | logs
7 | *.log
8 | npm-debug.log*
9 | yarn-debug.log*
10 | yarn-error.log*
11 |
12 | miniprogram_dist
13 | miniprogram_dev
14 | node_modules
15 | coverage
16 | examples/**/dist
17 | examples/demo21/mp/common
18 | examples/demo21/mp/miniprogram_npm
19 | examples/demo21/mp/package1
20 | examples/**/package-lock.json
21 |
22 | .vscode
--------------------------------------------------------------------------------
/docs/advanced.md:
--------------------------------------------------------------------------------
1 | ## 文档迁移
2 |
3 | 文档已迁移至:[https://wechat-miniprogram.github.io/kbone/docs/guide/advanced.html](https://wechat-miniprogram.github.io/kbone/docs/guide/advanced.html)。
4 |
--------------------------------------------------------------------------------
/docs/develop.md:
--------------------------------------------------------------------------------
1 | ## 文档迁移
2 |
3 | 文档已迁移至:[https://wechat-miniprogram.github.io/kbone/docs/guide/develop.html](https://wechat-miniprogram.github.io/kbone/docs/guide/develop.html)。
4 |
--------------------------------------------------------------------------------
/docs/domextend.md:
--------------------------------------------------------------------------------
1 | ## 文档迁移
2 |
3 | 文档已迁移至:[https://wechat-miniprogram.github.io/kbone/docs/domextend/](https://wechat-miniprogram.github.io/kbone/docs/domextend/)。
4 |
--------------------------------------------------------------------------------
/docs/images/01.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tencent/kbone/55fa1e27295b8b26e43c1487167ea07345eb88a2/docs/images/01.jpg
--------------------------------------------------------------------------------
/docs/images/02.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tencent/kbone/55fa1e27295b8b26e43c1487167ea07345eb88a2/docs/images/02.png
--------------------------------------------------------------------------------
/docs/images/03.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tencent/kbone/55fa1e27295b8b26e43c1487167ea07345eb88a2/docs/images/03.jpg
--------------------------------------------------------------------------------
/docs/images/code1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tencent/kbone/55fa1e27295b8b26e43c1487167ea07345eb88a2/docs/images/code1.jpg
--------------------------------------------------------------------------------
/docs/miniprogram.config.js:
--------------------------------------------------------------------------------
1 | /**
2 | * 文档已迁移至:https://wechat-miniprogram.github.io/kbone/docs/config/
3 | */
4 |
--------------------------------------------------------------------------------
/docs/principle.md:
--------------------------------------------------------------------------------
1 | ## 文档迁移
2 |
3 | 文档已迁移至:[https://wechat-miniprogram.github.io/kbone/docs/guide/principle.html](https://wechat-miniprogram.github.io/kbone/docs/guide/principle.html)。
4 |
--------------------------------------------------------------------------------
/docs/question.md:
--------------------------------------------------------------------------------
1 | ## 文档迁移
2 |
3 | 文档已迁移至:[https://wechat-miniprogram.github.io/kbone/docs/qa/](https://wechat-miniprogram.github.io/kbone/docs/qa/)。
4 |
--------------------------------------------------------------------------------
/docs/quickstart.md:
--------------------------------------------------------------------------------
1 | ## 文档迁移
2 |
3 | 文档已迁移至:[https://wechat-miniprogram.github.io/kbone/docs/guide/quickstart.html](https://wechat-miniprogram.github.io/kbone/docs/guide/quickstart.html)。
4 |
--------------------------------------------------------------------------------
/docs/tutorial.md:
--------------------------------------------------------------------------------
1 | ## 文档迁移
2 |
3 | 文档已迁移至:[https://wechat-miniprogram.github.io/kbone/docs/guide/tutorial.html](https://wechat-miniprogram.github.io/kbone/docs/guide/tutorial.html)。
4 |
--------------------------------------------------------------------------------
/examples/demo1/src/common/Footer.vue:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
10 |
11 |
18 |
--------------------------------------------------------------------------------
/examples/demo1/src/index/AAA.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
I am aaa
4 |
route: {{route}}
5 |
6 |
7 |
8 |
18 |
19 |
25 |
--------------------------------------------------------------------------------
/examples/demo1/src/index/BBB.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
I am bbb
4 |
route: {{route}}
5 |
6 |
7 |
8 |
18 |
19 |
25 |
--------------------------------------------------------------------------------
/examples/demo10/src/custom-components/common/utils.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | getWords() {
3 | return 'Hello, '
4 | },
5 | }
6 |
--------------------------------------------------------------------------------
/examples/demo10/src/custom-components/comp-a.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true
3 | }
--------------------------------------------------------------------------------
/examples/demo10/src/custom-components/comp-a.wxml:
--------------------------------------------------------------------------------
1 | comp-a
2 |
3 |
4 | {{prefix}}-{{str}}-{{suffix}}
5 |
6 | testObj: {{testObj.a}} - {{testObj.b}}
7 | testArr: {{item}}
8 | testDefaultVal: {{testDefaultVal}}
9 |
--------------------------------------------------------------------------------
/examples/demo10/src/custom-components/comp-a.wxss:
--------------------------------------------------------------------------------
1 | .prefix, .suffix {
2 | color: green;
3 | }
4 |
5 | .btn {
6 | margin: 15px 0;
7 | display: block;
8 | width: 100%;
9 | height: 30px;
10 | line-height: 30px;
11 | text-align: center;
12 | font-size: 20px;
13 | border: 1px solid #ddd;
14 | }
15 |
--------------------------------------------------------------------------------
/examples/demo10/src/custom-components/comp-b/index.js:
--------------------------------------------------------------------------------
1 | const _ = require('../common/utils')
2 |
3 | Component({
4 | properties: {
5 | prefix: {
6 | type: String,
7 | value: 'defaultPrefix',
8 | },
9 | suffix: {
10 | type: String,
11 | value: 'defaultSuffix',
12 | },
13 | name: {
14 | type: String,
15 | value: '',
16 | },
17 | },
18 | data: {
19 | str: _.getWords() + 'comp-b',
20 | },
21 | })
22 |
--------------------------------------------------------------------------------
/examples/demo10/src/custom-components/comp-b/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true
3 | }
--------------------------------------------------------------------------------
/examples/demo10/src/custom-components/comp-b/index.wxml:
--------------------------------------------------------------------------------
1 | comp-b
2 | {{prefix}}-{{str}}-{{suffix}}-{{name}}
3 |
4 |
--------------------------------------------------------------------------------
/examples/demo10/src/custom-components/comp-b/index.wxss:
--------------------------------------------------------------------------------
1 | .prefix, .suffix {
2 | color: green;
3 | }
4 |
--------------------------------------------------------------------------------
/examples/demo10/src/custom-components/comp-c.js:
--------------------------------------------------------------------------------
1 | Component({})
--------------------------------------------------------------------------------
/examples/demo10/src/custom-components/comp-c.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {
4 | "comp-d": "./comp-d"
5 | }
6 | }
--------------------------------------------------------------------------------
/examples/demo10/src/custom-components/comp-c.wxml:
--------------------------------------------------------------------------------
1 | comp-c
2 |
3 | comp-d slot
4 |
5 |
--------------------------------------------------------------------------------
/examples/demo10/src/custom-components/comp-c.wxss:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tencent/kbone/55fa1e27295b8b26e43c1487167ea07345eb88a2/examples/demo10/src/custom-components/comp-c.wxss
--------------------------------------------------------------------------------
/examples/demo10/src/custom-components/comp-d.js:
--------------------------------------------------------------------------------
1 | Component({})
--------------------------------------------------------------------------------
/examples/demo10/src/custom-components/comp-d.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true
3 | }
--------------------------------------------------------------------------------
/examples/demo10/src/custom-components/comp-d.wxml:
--------------------------------------------------------------------------------
1 | comp-d
2 |
--------------------------------------------------------------------------------
/examples/demo10/src/custom-components/comp-d.wxss:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tencent/kbone/55fa1e27295b8b26e43c1487167ea07345eb88a2/examples/demo10/src/custom-components/comp-d.wxss
--------------------------------------------------------------------------------
/examples/demo10/src/custom-components/comp-e/index.js:
--------------------------------------------------------------------------------
1 | Component({
2 | externalClasses: ['my-class'],
3 | })
4 |
--------------------------------------------------------------------------------
/examples/demo10/src/custom-components/comp-e/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true
3 | }
--------------------------------------------------------------------------------
/examples/demo10/src/custom-components/comp-e/index.wxml:
--------------------------------------------------------------------------------
1 | comp-e
2 | external-classes
3 |
4 |
--------------------------------------------------------------------------------
/examples/demo10/src/custom-components/comp-e/index.wxss:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tencent/kbone/55fa1e27295b8b26e43c1487167ea07345eb88a2/examples/demo10/src/custom-components/comp-e/index.wxss
--------------------------------------------------------------------------------
/examples/demo10/src/index/main.mp.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './App.vue'
3 |
4 | export default function createApp() {
5 | const container = document.createElement('div')
6 | container.id = 'app'
7 | document.body.appendChild(container)
8 |
9 | return new Vue({
10 | el: '#app',
11 | render: h => h(App)
12 | })
13 | }
14 |
--------------------------------------------------------------------------------
/examples/demo10/src/other/App.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
kbone
4 |
5 | comp-e slot
6 |
7 |
8 |
9 |
10 |
15 |
16 |
33 |
--------------------------------------------------------------------------------
/examples/demo10/src/other/main.mp.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './App.vue'
3 |
4 | export default function createApp() {
5 | const container = document.createElement('div')
6 | container.id = 'app'
7 | document.body.appendChild(container)
8 |
9 | return new Vue({
10 | el: '#app',
11 | render: h => h(App)
12 | })
13 | }
14 |
--------------------------------------------------------------------------------
/examples/demo11/src/common/Footer.vue:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
10 |
11 |
18 |
--------------------------------------------------------------------------------
/examples/demo11/src/common/Header.vue:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
10 |
11 |
18 |
--------------------------------------------------------------------------------
/examples/demo11/src/custom-tab-bar/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true
3 | }
--------------------------------------------------------------------------------
/examples/demo11/src/custom-tab-bar/index.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {{item.text}}
6 |
7 |
8 |
--------------------------------------------------------------------------------
/examples/demo11/src/img/page1-sel.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tencent/kbone/55fa1e27295b8b26e43c1487167ea07345eb88a2/examples/demo11/src/img/page1-sel.png
--------------------------------------------------------------------------------
/examples/demo11/src/img/page1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tencent/kbone/55fa1e27295b8b26e43c1487167ea07345eb88a2/examples/demo11/src/img/page1.png
--------------------------------------------------------------------------------
/examples/demo11/src/img/page2-sel.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tencent/kbone/55fa1e27295b8b26e43c1487167ea07345eb88a2/examples/demo11/src/img/page2-sel.png
--------------------------------------------------------------------------------
/examples/demo11/src/img/page2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tencent/kbone/55fa1e27295b8b26e43c1487167ea07345eb88a2/examples/demo11/src/img/page2.png
--------------------------------------------------------------------------------
/examples/demo11/src/page1/main.mp.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './App.vue'
3 |
4 | export default function createApp() {
5 | const container = document.createElement('div')
6 | container.id = 'app'
7 | document.body.appendChild(container)
8 |
9 | return new Vue({
10 | el: '#app',
11 | render: h => h(App)
12 | })
13 | }
14 |
--------------------------------------------------------------------------------
/examples/demo11/src/page2/main.mp.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './App.vue'
3 |
4 | export default function createApp() {
5 | const container = document.createElement('div')
6 | container.id = 'app'
7 | document.body.appendChild(container)
8 |
9 | return new Vue({
10 | el: '#app',
11 | render: h => h(App)
12 | })
13 | }
14 |
--------------------------------------------------------------------------------
/examples/demo11/src/page3/main.mp.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './App.vue'
3 |
4 | export default function createApp() {
5 | const container = document.createElement('div')
6 | container.id = 'app'
7 | document.body.appendChild(container)
8 |
9 | return new Vue({
10 | el: '#app',
11 | render: h => h(App)
12 | })
13 | }
14 |
--------------------------------------------------------------------------------
/examples/demo12/build/miniprogram.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | origin: 'https://test.miniprogram.com',
3 | entry: '/test/aaa',
4 | router: {
5 | index: [
6 | '/test/aaa',
7 | '/test/bbb',
8 | ],
9 | },
10 | redirect: {
11 | notFound: 'index',
12 | accessDenied: 'index',
13 | },
14 | generate: {
15 | app: 'noemit',
16 | },
17 | app: {
18 | navigationBarTitleText: 'miniprogram-project',
19 | },
20 | projectConfig: {
21 | appid: 'wx14c7c4cd189644a1',
22 | projectname: 'kbone-demo12',
23 | },
24 | packageConfig: {
25 | author: 'wechat-miniprogram',
26 | },
27 | }
--------------------------------------------------------------------------------
/examples/demo12/src/common/Footer.vue:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
10 |
11 |
18 |
--------------------------------------------------------------------------------
/examples/demo12/src/index/AAA.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
I am aaa
4 |
route: {{route}}
5 |
6 |
7 |
8 |
18 |
19 |
25 |
--------------------------------------------------------------------------------
/examples/demo12/src/index/BBB.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
I am bbb
4 |
route: {{route}}
5 |
6 |
7 |
8 |
18 |
19 |
25 |
--------------------------------------------------------------------------------
/examples/demo13/build/miniprogram.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | origin: 'https://test.miniprogram.com',
3 | entry: '/test/aaa',
4 | router: {
5 | index: ['/test/aaa'],
6 | },
7 | redirect: {
8 | notFound: 'index',
9 | accessDenied: 'index',
10 | },
11 | app: {
12 | navigationBarTitleText: 'miniprogram-project',
13 | },
14 | projectConfig: {
15 | appid: 'wx14c7c4cd189644a1',
16 | projectname: 'kbone-demo13',
17 | },
18 | packageConfig: {
19 | author: 'wechat-miniprogram',
20 | },
21 | }
--------------------------------------------------------------------------------
/examples/demo13/src/index/main.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import todo from './todo.vue'
3 |
4 | new Vue({
5 | el: '#app',
6 | render: h => h(todo)
7 | })
8 |
--------------------------------------------------------------------------------
/examples/demo13/src/index/main.mp.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import todo from './todo.vue'
3 |
4 | export default function createApp() {
5 | const container = document.createElement('div')
6 | container.id = 'app'
7 | document.body.appendChild(container)
8 |
9 | return new Vue({
10 | el: '#app',
11 | render: h => h(todo)
12 | })
13 | }
14 |
--------------------------------------------------------------------------------
/examples/demo14/build/miniprogram.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | origin: 'https://test.miniprogram.com',
3 | entry: '/test/aaa',
4 | router: {
5 | index: [
6 | '/test/aaa',
7 | '/test/bbb',
8 | ],
9 | },
10 | redirect: {
11 | notFound: 'index',
12 | accessDenied: 'index',
13 | },
14 | generate: {
15 | autoBuildNpm: false,
16 | },
17 | app: {
18 | navigationBarTitleText: 'miniprogram-project',
19 | },
20 | projectConfig: {
21 | appid: 'wx14c7c4cd189644a1',
22 | projectname: 'kbone-demo14',
23 | },
24 | packageConfig: {
25 | author: 'wechat-miniprogram',
26 | },
27 | }
--------------------------------------------------------------------------------
/examples/demo14/src/common/Footer.vue:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
10 |
11 |
18 |
--------------------------------------------------------------------------------
/examples/demo14/src/index/AAA.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
I am aaa, {{$t("hello")}}
4 |
route: {{route}}
5 |
6 |
7 |
8 |
18 |
19 |
25 |
--------------------------------------------------------------------------------
/examples/demo14/src/index/BBB.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
I am bbb, {{$t("hello")}}
4 |
route: {{route}}
5 |
6 |
7 |
8 |
18 |
19 |
25 |
--------------------------------------------------------------------------------
/examples/demo14/src/index/locales.json:
--------------------------------------------------------------------------------
1 | {
2 | "en": {
3 | "hello": "hello world"
4 | },
5 | "ja": {
6 | "hello": "こんにちは、世界"
7 | }
8 | }
--------------------------------------------------------------------------------
/examples/demo15/build/miniprogram.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | origin: 'https://test.miniprogram.com',
3 | entry: '/test/aaa',
4 | router: {
5 | index: [
6 | '/test/aaa',
7 | '/test/bbb',
8 | ],
9 | },
10 | redirect: {
11 | notFound: 'index',
12 | accessDenied: 'index',
13 | },
14 | generate: {
15 | autoBuildNpm: false,
16 | },
17 | app: {
18 | navigationBarTitleText: 'miniprogram-project',
19 | },
20 | projectConfig: {
21 | appid: 'wx14c7c4cd189644a1',
22 | projectname: 'kbone-demo15',
23 | },
24 | packageConfig: {
25 | author: 'wechat-miniprogram',
26 | },
27 | }
--------------------------------------------------------------------------------
/examples/demo15/src/index/main.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './App.vue'
3 |
4 | new Vue({
5 | el: '#app',
6 | render: h => h(App)
7 | })
8 |
--------------------------------------------------------------------------------
/examples/demo15/src/index/main.mp.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './App.vue'
3 |
4 | export default function createApp() {
5 | const container = document.createElement('div')
6 | container.id = 'app'
7 | document.body.appendChild(container)
8 |
9 | return new Vue({
10 | el: '#app',
11 | render: h => h(App)
12 | })
13 | }
14 |
--------------------------------------------------------------------------------
/examples/demo16/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": [
3 | "env",
4 | "stage-3",
5 | "react"
6 | ],
7 | "plugins": [
8 | "transform-runtime"
9 | ]
10 | }
--------------------------------------------------------------------------------
/examples/demo16/build/miniprogram.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | origin: 'https://test.miniprogram.com',
3 | entry: '/view1',
4 | router: {
5 | index: ['/view1', '/view2'],
6 | },
7 | redirect: {
8 | notFound: 'index',
9 | accessDenied: 'index',
10 | },
11 | app: {
12 | navigationBarTitleText: 'miniprogram-project',
13 | },
14 | projectConfig: {
15 | appid: 'wx14c7c4cd189644a1',
16 | projectname: 'kbone-demo16',
17 | },
18 | packageConfig: {
19 | author: 'wechat-miniprogram',
20 | },
21 | }
--------------------------------------------------------------------------------
/examples/demo16/src/fragment.jsx:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 |
3 | class TestFragment extends React.Component {
4 | render() {
5 | return (
6 |
7 | fragment 1
8 | fragment 2
9 | fragment 3
10 |
11 | )
12 | }
13 | }
14 |
15 | export default TestFragment
16 |
--------------------------------------------------------------------------------
/examples/demo16/src/main.jsx:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import {render, h} from 'react-dom'
3 | import App from './app'
4 |
5 | render(, document.getElementById('app'))
6 |
--------------------------------------------------------------------------------
/examples/demo16/src/main.mp.jsx:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import {render, h} from 'react-dom'
3 | import App from './app'
4 |
5 | export default function createApp() {
6 | const container = document.createElement('div')
7 | container.id = 'app'
8 | document.body.appendChild(container)
9 |
10 | render(, container)
11 | }
12 |
--------------------------------------------------------------------------------
/examples/demo16/src/view1.jsx:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 |
3 | class View1 extends React.Component {
4 | render() {
5 | return (
6 |
7 |
I am view1
8 |
route: {this.props.match.path}
9 |
10 | )
11 | }
12 | }
13 |
14 | export default View1
15 |
--------------------------------------------------------------------------------
/examples/demo16/src/view2.jsx:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 |
3 | class View2 extends React.Component {
4 | render() {
5 | return (
6 |
7 |
I am view2
8 |
route: {this.props.match.path}
9 |
10 | )
11 | }
12 | }
13 |
14 | export default View2
15 |
--------------------------------------------------------------------------------
/examples/demo16/src/view3.jsx:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 |
3 | class View3 extends React.Component {
4 | render() {
5 | return (
6 |
7 |
I am view3
8 |
route: {this.props.match.path}
9 |
10 | )
11 | }
12 | }
13 |
14 | export default View3
15 |
--------------------------------------------------------------------------------
/examples/demo17/build/miniprogram.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | origin: 'https://test.miniprogram.com',
3 | entry: '/test/aaa',
4 | router: {
5 | index: ['/test/aaa'],
6 | },
7 | redirect: {
8 | notFound: 'index',
9 | accessDenied: 'index',
10 | },
11 | app: {
12 | navigationBarTitleText: 'miniprogram-project',
13 | },
14 | projectConfig: {
15 | appid: 'wx14c7c4cd189644a1',
16 | projectname: 'kbone-demo17',
17 | },
18 | packageConfig: {
19 | author: 'wechat-miniprogram',
20 | },
21 | }
--------------------------------------------------------------------------------
/examples/demo17/src/app.css:
--------------------------------------------------------------------------------
1 | span {
2 | color: red;
3 | }
4 |
--------------------------------------------------------------------------------
/examples/demo17/src/main.jsx:
--------------------------------------------------------------------------------
1 | import {render, h} from 'preact'
2 | import App from './app'
3 |
4 | render(, document.getElementById('app'))
5 |
--------------------------------------------------------------------------------
/examples/demo17/src/main.mp.jsx:
--------------------------------------------------------------------------------
1 | import {render, h} from 'preact'
2 | import App from './app'
3 |
4 | export default function createApp() {
5 | const container = document.createElement('div')
6 | container.id = 'app'
7 | document.body.appendChild(container)
8 |
9 | render(, container)
10 | }
11 |
--------------------------------------------------------------------------------
/examples/demo18/build/miniprogram.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | origin: 'https://test.miniprogram.com',
3 | entry: '/',
4 | router: {
5 | page1: ['/a'],
6 | page2: ['/b'],
7 | page3: ['/c'],
8 | },
9 | redirect: {
10 | notFound: 'page1',
11 | accessDenied: 'page1',
12 | },
13 | runtime: {
14 | cookieStore: 'globalstorage',
15 | },
16 | app: {
17 | navigationBarTitleText: 'miniprogram-project',
18 | },
19 | projectConfig: {
20 | appid: 'wx14c7c4cd189644a1',
21 | projectname: 'kbone-demo18',
22 | },
23 | packageConfig: {
24 | author: 'wechat-miniprogram',
25 | },
26 | }
--------------------------------------------------------------------------------
/examples/demo18/src/common/Footer.vue:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
10 |
11 |
18 |
--------------------------------------------------------------------------------
/examples/demo18/src/common/Header.vue:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
10 |
11 |
18 |
--------------------------------------------------------------------------------
/examples/demo18/src/page1/main.mp.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './App.vue'
3 |
4 | export default function createApp() {
5 | const container = document.createElement('div')
6 | container.id = 'app'
7 | document.body.appendChild(container)
8 |
9 | return new Vue({
10 | el: '#app',
11 | render: h => h(App)
12 | })
13 | }
14 |
--------------------------------------------------------------------------------
/examples/demo18/src/page2/main.mp.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './App.vue'
3 |
4 | export default function createApp() {
5 | const container = document.createElement('div')
6 | container.id = 'app'
7 | document.body.appendChild(container)
8 |
9 | return new Vue({
10 | el: '#app',
11 | render: h => h(App)
12 | })
13 | }
14 |
--------------------------------------------------------------------------------
/examples/demo18/src/page3/main.mp.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './App.vue'
3 |
4 | export default function createApp() {
5 | const container = document.createElement('div')
6 | container.id = 'app'
7 | document.body.appendChild(container)
8 |
9 | return new Vue({
10 | el: '#app',
11 | render: h => h(App)
12 | })
13 | }
14 |
--------------------------------------------------------------------------------
/examples/demo19/cloudfunctions/callback/config.json:
--------------------------------------------------------------------------------
1 | {
2 | "permissions": {
3 | "openapi": [
4 | "customerServiceMessage.send"
5 | ]
6 | }
7 | }
--------------------------------------------------------------------------------
/examples/demo19/cloudfunctions/callback/index.js:
--------------------------------------------------------------------------------
1 | const cloud = require('wx-server-sdk')
2 |
3 | cloud.init({
4 | // API 调用都保持和云函数当前所在环境一致
5 | env: cloud.DYNAMIC_CURRENT_ENV
6 | })
7 |
8 | // 云函数入口函数
9 | exports.main = async (event, context) => {
10 |
11 | console.log(event)
12 |
13 | const { OPENID } = cloud.getWXContext()
14 |
15 | const result = await cloud.openapi.customerServiceMessage.send({
16 | touser: OPENID,
17 | msgtype: 'text',
18 | text: {
19 | content: '收到:' + event.Content,
20 | }
21 | })
22 |
23 | console.log(result)
24 |
25 | return result
26 | }
27 |
--------------------------------------------------------------------------------
/examples/demo19/cloudfunctions/callback/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "callback",
3 | "version": "1.0.0",
4 | "description": "",
5 | "main": "index.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1"
8 | },
9 | "author": "",
10 | "license": "ISC",
11 | "dependencies": {
12 | "wx-server-sdk": "latest"
13 | }
14 | }
--------------------------------------------------------------------------------
/examples/demo19/cloudfunctions/echo/config.json:
--------------------------------------------------------------------------------
1 | {
2 | "permissions": {
3 | "openapi": []
4 | }
5 | }
6 |
--------------------------------------------------------------------------------
/examples/demo19/cloudfunctions/echo/index.js:
--------------------------------------------------------------------------------
1 | const cloud = require('wx-server-sdk')
2 |
3 | exports.main = async (event, context) => {
4 | // event.userInfo 是已废弃的保留字段,在此不做展示
5 | // 获取 OPENID 等微信上下文请使用 cloud.getWXContext()
6 | delete event.userInfo
7 | return event
8 | }
9 |
--------------------------------------------------------------------------------
/examples/demo19/cloudfunctions/echo/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "echo",
3 | "version": "1.0.0",
4 | "description": "",
5 | "main": "index.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1"
8 | },
9 | "author": "",
10 | "license": "ISC",
11 | "dependencies": {
12 | "wx-server-sdk": "latest"
13 | }
14 | }
--------------------------------------------------------------------------------
/examples/demo19/cloudfunctions/login/config.json:
--------------------------------------------------------------------------------
1 | {
2 | "permissions": {
3 | "openapi": []
4 | }
5 | }
6 |
--------------------------------------------------------------------------------
/examples/demo19/cloudfunctions/login/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "login",
3 | "version": "1.0.0",
4 | "description": "",
5 | "main": "index.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1"
8 | },
9 | "author": "",
10 | "license": "ISC",
11 | "dependencies": {
12 | "wx-server-sdk": "latest"
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/examples/demo19/cloudfunctions/openapi/config.json:
--------------------------------------------------------------------------------
1 | {
2 | "permissions": {
3 | "openapi": [
4 | "wxacode.get",
5 | "subscribeMessage.send",
6 | "subscribeMessage.addTemplate",
7 | "templateMessage.send",
8 | "templateMessage.addTemplate",
9 | "templateMessage.deleteTemplate",
10 | "templateMessage.getTemplateList",
11 | "templateMessage.getTemplateLibraryById",
12 | "templateMessage.getTemplateLibraryList"
13 | ]
14 | }
15 | }
--------------------------------------------------------------------------------
/examples/demo19/cloudfunctions/openapi/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "openapi",
3 | "version": "1.0.0",
4 | "description": "",
5 | "main": "index.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1"
8 | },
9 | "author": "",
10 | "license": "ISC",
11 | "dependencies": {
12 | "wx-server-sdk": "latest"
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/examples/demo19/src/app.js:
--------------------------------------------------------------------------------
1 | import './app.css'
2 |
3 | App({
4 | onLaunch(options) {
5 | if (!wx.cloud) {
6 | console.error('请使用 2.2.3 或以上的基础库以使用云能力')
7 | } else {
8 | wx.cloud.init({
9 | // env 参数说明:
10 | // env 参数决定接下来小程序发起的云开发调用(wx.cloud.xxx)会默认请求到哪个云环境的资源
11 | // 此处请填入环境 ID, 环境 ID 可打开云控制台查看
12 | // 如不填则使用默认环境(第一个创建的环境)
13 | // env: 'my-env-id',
14 | traceUser: true,
15 | })
16 | }
17 |
18 | this.globalData = {}
19 | },
20 | })
21 |
--------------------------------------------------------------------------------
/examples/demo19/src/chooselib/App.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | 初始化失败
6 |
7 |
8 | 请使用 2.2.3 或以上的基础库以使用云能力
9 |
10 |
11 |
12 |
13 |
14 |
17 |
18 |
25 |
--------------------------------------------------------------------------------
/examples/demo19/src/chooselib/main.mp.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './App.vue'
3 |
4 | export default function createApp() {
5 | const container = document.createElement('div')
6 | container.id = 'app'
7 | document.body.appendChild(container)
8 |
9 | return new Vue({
10 | el: '#app',
11 | render: h => h(App)
12 | })
13 | }
14 |
--------------------------------------------------------------------------------
/examples/demo19/src/databaseguide/main.mp.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './App.vue'
3 |
4 | export default function createApp() {
5 | const container = document.createElement('div')
6 | container.id = 'app'
7 | document.body.appendChild(container)
8 |
9 | return new Vue({
10 | el: '#app',
11 | render: h => h(App)
12 | })
13 | }
14 |
--------------------------------------------------------------------------------
/examples/demo19/src/deployfunctions/main.mp.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './App.vue'
3 |
4 | export default function createApp() {
5 | const container = document.createElement('div')
6 | container.id = 'app'
7 | document.body.appendChild(container)
8 |
9 | return new Vue({
10 | el: '#app',
11 | render: h => h(App)
12 | })
13 | }
14 |
--------------------------------------------------------------------------------
/examples/demo19/src/images/console-entrance.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tencent/kbone/55fa1e27295b8b26e43c1487167ea07345eb88a2/examples/demo19/src/images/console-entrance.png
--------------------------------------------------------------------------------
/examples/demo19/src/images/create-collection.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tencent/kbone/55fa1e27295b8b26e43c1487167ea07345eb88a2/examples/demo19/src/images/create-collection.png
--------------------------------------------------------------------------------
/examples/demo19/src/images/user-unlogin.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tencent/kbone/55fa1e27295b8b26e43c1487167ea07345eb88a2/examples/demo19/src/images/user-unlogin.png
--------------------------------------------------------------------------------
/examples/demo19/src/index/main.mp.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './App.vue'
3 |
4 | export default function createApp() {
5 | const container = document.createElement('div')
6 | container.id = 'app'
7 | document.body.appendChild(container)
8 |
9 | return new Vue({
10 | el: '#app',
11 | render: h => h(App)
12 | })
13 | }
14 |
--------------------------------------------------------------------------------
/examples/demo19/src/storageconsole/main.mp.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './App.vue'
3 |
4 | export default function createApp() {
5 | const container = document.createElement('div')
6 | container.id = 'app'
7 | document.body.appendChild(container)
8 |
9 | return new Vue({
10 | el: '#app',
11 | render: h => h(App)
12 | })
13 | }
14 |
--------------------------------------------------------------------------------
/examples/demo19/src/userconsole/main.mp.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './App.vue'
3 |
4 | export default function createApp() {
5 | const container = document.createElement('div')
6 | container.id = 'app'
7 | document.body.appendChild(container)
8 |
9 | return new Vue({
10 | el: '#app',
11 | render: h => h(App)
12 | })
13 | }
14 |
--------------------------------------------------------------------------------
/examples/demo2/build/miniprogram.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | origin: 'https://test.miniprogram.com',
3 | entry: '/',
4 | router: {
5 | index: [
6 | '/',
7 | ],
8 | },
9 | redirect: {
10 | notFound: 'index',
11 | accessDenied: 'index',
12 | },
13 | app: {
14 | navigationBarTitleText: 'miniprogram-project',
15 | },
16 | global: {
17 | extra: {
18 | navigationBarTextStyle: 'black',
19 | },
20 | },
21 | projectConfig: {
22 | appid: 'wx14c7c4cd189644a1',
23 | projectname: 'kbone-demo2',
24 | },
25 | packageConfig: {
26 | author: 'wechat-miniprogram',
27 | },
28 | }
--------------------------------------------------------------------------------
/examples/demo2/src/common/Footer.vue:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
10 |
11 |
18 |
--------------------------------------------------------------------------------
/examples/demo2/src/common/Header.vue:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
10 |
11 |
18 |
--------------------------------------------------------------------------------
/examples/demo2/src/index/main.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './App.vue'
3 |
4 | new Vue({
5 | el: '#app',
6 | render: h => h(App)
7 | })
8 |
--------------------------------------------------------------------------------
/examples/demo2/src/index/main.mp.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './App.vue'
3 |
4 | export default function createApp() {
5 | const container = document.createElement('div')
6 | container.id = 'app'
7 | document.body.appendChild(container)
8 |
9 | return new Vue({
10 | el: '#app',
11 | render: h => h(App)
12 | })
13 | }
14 |
--------------------------------------------------------------------------------
/examples/demo2/src/index/printf.js:
--------------------------------------------------------------------------------
1 | export function printf1() {
2 | console.log('printf1')
3 | }
4 |
5 | export function printf2() {
6 | console.log('printf2')
7 | }
8 |
--------------------------------------------------------------------------------
/examples/demo2/src/index/web.js:
--------------------------------------------------------------------------------
1 | console.log('web')
2 |
--------------------------------------------------------------------------------
/examples/demo20/src/bar/main.mp.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './App.vue'
3 |
4 | export default function createApp() {
5 | const container = document.createElement('div')
6 | container.id = 'app'
7 | document.body.appendChild(container)
8 |
9 | return new Vue({
10 | el: '#app',
11 | render: h => h(App)
12 | })
13 | }
14 |
--------------------------------------------------------------------------------
/examples/demo20/src/boxplot/main.mp.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './App.vue'
3 |
4 | export default function createApp() {
5 | const container = document.createElement('div')
6 | container.id = 'app'
7 | document.body.appendChild(container)
8 |
9 | return new Vue({
10 | el: '#app',
11 | render: h => h(App)
12 | })
13 | }
14 |
--------------------------------------------------------------------------------
/examples/demo20/src/funnel/main.mp.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './App.vue'
3 |
4 | export default function createApp() {
5 | const container = document.createElement('div')
6 | container.id = 'app'
7 | document.body.appendChild(container)
8 |
9 | return new Vue({
10 | el: '#app',
11 | render: h => h(App)
12 | })
13 | }
14 |
--------------------------------------------------------------------------------
/examples/demo20/src/gauge/main.mp.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './App.vue'
3 |
4 | export default function createApp() {
5 | const container = document.createElement('div')
6 | container.id = 'app'
7 | document.body.appendChild(container)
8 |
9 | return new Vue({
10 | el: '#app',
11 | render: h => h(App)
12 | })
13 | }
14 |
--------------------------------------------------------------------------------
/examples/demo20/src/graph/main.mp.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './App.vue'
3 |
4 | export default function createApp() {
5 | const container = document.createElement('div')
6 | container.id = 'app'
7 | document.body.appendChild(container)
8 |
9 | return new Vue({
10 | el: '#app',
11 | render: h => h(App)
12 | })
13 | }
14 |
--------------------------------------------------------------------------------
/examples/demo20/src/heatmap/main.mp.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './App.vue'
3 |
4 | export default function createApp() {
5 | const container = document.createElement('div')
6 | container.id = 'app'
7 | document.body.appendChild(container)
8 |
9 | return new Vue({
10 | el: '#app',
11 | render: h => h(App)
12 | })
13 | }
14 |
--------------------------------------------------------------------------------
/examples/demo20/src/images/bar.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tencent/kbone/55fa1e27295b8b26e43c1487167ea07345eb88a2/examples/demo20/src/images/bar.png
--------------------------------------------------------------------------------
/examples/demo20/src/images/boxplot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tencent/kbone/55fa1e27295b8b26e43c1487167ea07345eb88a2/examples/demo20/src/images/boxplot.png
--------------------------------------------------------------------------------
/examples/demo20/src/images/custom.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tencent/kbone/55fa1e27295b8b26e43c1487167ea07345eb88a2/examples/demo20/src/images/custom.png
--------------------------------------------------------------------------------
/examples/demo20/src/images/funnel.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tencent/kbone/55fa1e27295b8b26e43c1487167ea07345eb88a2/examples/demo20/src/images/funnel.png
--------------------------------------------------------------------------------
/examples/demo20/src/images/gauge.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tencent/kbone/55fa1e27295b8b26e43c1487167ea07345eb88a2/examples/demo20/src/images/gauge.png
--------------------------------------------------------------------------------
/examples/demo20/src/images/graph.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tencent/kbone/55fa1e27295b8b26e43c1487167ea07345eb88a2/examples/demo20/src/images/graph.png
--------------------------------------------------------------------------------
/examples/demo20/src/images/heatmap.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tencent/kbone/55fa1e27295b8b26e43c1487167ea07345eb88a2/examples/demo20/src/images/heatmap.png
--------------------------------------------------------------------------------
/examples/demo20/src/images/k.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tencent/kbone/55fa1e27295b8b26e43c1487167ea07345eb88a2/examples/demo20/src/images/k.png
--------------------------------------------------------------------------------
/examples/demo20/src/images/line.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tencent/kbone/55fa1e27295b8b26e43c1487167ea07345eb88a2/examples/demo20/src/images/line.png
--------------------------------------------------------------------------------
/examples/demo20/src/images/map.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tencent/kbone/55fa1e27295b8b26e43c1487167ea07345eb88a2/examples/demo20/src/images/map.png
--------------------------------------------------------------------------------
/examples/demo20/src/images/parallel.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tencent/kbone/55fa1e27295b8b26e43c1487167ea07345eb88a2/examples/demo20/src/images/parallel.png
--------------------------------------------------------------------------------
/examples/demo20/src/images/pictorialbar.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tencent/kbone/55fa1e27295b8b26e43c1487167ea07345eb88a2/examples/demo20/src/images/pictorialbar.png
--------------------------------------------------------------------------------
/examples/demo20/src/images/pie.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tencent/kbone/55fa1e27295b8b26e43c1487167ea07345eb88a2/examples/demo20/src/images/pie.png
--------------------------------------------------------------------------------
/examples/demo20/src/images/radar.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tencent/kbone/55fa1e27295b8b26e43c1487167ea07345eb88a2/examples/demo20/src/images/radar.png
--------------------------------------------------------------------------------
/examples/demo20/src/images/sankey.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tencent/kbone/55fa1e27295b8b26e43c1487167ea07345eb88a2/examples/demo20/src/images/sankey.png
--------------------------------------------------------------------------------
/examples/demo20/src/images/scatter.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tencent/kbone/55fa1e27295b8b26e43c1487167ea07345eb88a2/examples/demo20/src/images/scatter.png
--------------------------------------------------------------------------------
/examples/demo20/src/images/sunburst.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tencent/kbone/55fa1e27295b8b26e43c1487167ea07345eb88a2/examples/demo20/src/images/sunburst.png
--------------------------------------------------------------------------------
/examples/demo20/src/images/themeRiver.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tencent/kbone/55fa1e27295b8b26e43c1487167ea07345eb88a2/examples/demo20/src/images/themeRiver.png
--------------------------------------------------------------------------------
/examples/demo20/src/images/tree.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tencent/kbone/55fa1e27295b8b26e43c1487167ea07345eb88a2/examples/demo20/src/images/tree.png
--------------------------------------------------------------------------------
/examples/demo20/src/images/treemap.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tencent/kbone/55fa1e27295b8b26e43c1487167ea07345eb88a2/examples/demo20/src/images/treemap.png
--------------------------------------------------------------------------------
/examples/demo20/src/index/main.mp.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './App.vue'
3 |
4 | export default function createApp() {
5 | const container = document.createElement('div')
6 | container.id = 'app'
7 | document.body.appendChild(container)
8 |
9 | return new Vue({
10 | el: '#app',
11 | render: h => h(App)
12 | })
13 | }
14 |
--------------------------------------------------------------------------------
/examples/demo20/src/k/main.mp.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './App.vue'
3 |
4 | export default function createApp() {
5 | const container = document.createElement('div')
6 | container.id = 'app'
7 | document.body.appendChild(container)
8 |
9 | return new Vue({
10 | el: '#app',
11 | render: h => h(App)
12 | })
13 | }
14 |
--------------------------------------------------------------------------------
/examples/demo20/src/line/main.mp.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './App.vue'
3 |
4 | export default function createApp() {
5 | const container = document.createElement('div')
6 | container.id = 'app'
7 | document.body.appendChild(container)
8 |
9 | return new Vue({
10 | el: '#app',
11 | render: h => h(App)
12 | })
13 | }
14 |
--------------------------------------------------------------------------------
/examples/demo20/src/map/main.mp.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './App.vue'
3 |
4 | export default function createApp() {
5 | const container = document.createElement('div')
6 | container.id = 'app'
7 | document.body.appendChild(container)
8 |
9 | return new Vue({
10 | el: '#app',
11 | render: h => h(App)
12 | })
13 | }
14 |
--------------------------------------------------------------------------------
/examples/demo20/src/parallel/main.mp.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './App.vue'
3 |
4 | export default function createApp() {
5 | const container = document.createElement('div')
6 | container.id = 'app'
7 | document.body.appendChild(container)
8 |
9 | return new Vue({
10 | el: '#app',
11 | render: h => h(App)
12 | })
13 | }
14 |
--------------------------------------------------------------------------------
/examples/demo20/src/pie/main.mp.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './App.vue'
3 |
4 | export default function createApp() {
5 | const container = document.createElement('div')
6 | container.id = 'app'
7 | document.body.appendChild(container)
8 |
9 | return new Vue({
10 | el: '#app',
11 | render: h => h(App)
12 | })
13 | }
14 |
--------------------------------------------------------------------------------
/examples/demo20/src/radar/main.mp.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './App.vue'
3 |
4 | export default function createApp() {
5 | const container = document.createElement('div')
6 | container.id = 'app'
7 | document.body.appendChild(container)
8 |
9 | return new Vue({
10 | el: '#app',
11 | render: h => h(App)
12 | })
13 | }
14 |
--------------------------------------------------------------------------------
/examples/demo20/src/sankey/main.mp.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './App.vue'
3 |
4 | export default function createApp() {
5 | const container = document.createElement('div')
6 | container.id = 'app'
7 | document.body.appendChild(container)
8 |
9 | return new Vue({
10 | el: '#app',
11 | render: h => h(App)
12 | })
13 | }
14 |
--------------------------------------------------------------------------------
/examples/demo20/src/scatter/main.mp.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './App.vue'
3 |
4 | export default function createApp() {
5 | const container = document.createElement('div')
6 | container.id = 'app'
7 | document.body.appendChild(container)
8 |
9 | return new Vue({
10 | el: '#app',
11 | render: h => h(App)
12 | })
13 | }
14 |
--------------------------------------------------------------------------------
/examples/demo20/src/sunburst/main.mp.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './App.vue'
3 |
4 | export default function createApp() {
5 | const container = document.createElement('div')
6 | container.id = 'app'
7 | document.body.appendChild(container)
8 |
9 | return new Vue({
10 | el: '#app',
11 | render: h => h(App)
12 | })
13 | }
14 |
--------------------------------------------------------------------------------
/examples/demo20/src/themeriver/main.mp.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './App.vue'
3 |
4 | export default function createApp() {
5 | const container = document.createElement('div')
6 | container.id = 'app'
7 | document.body.appendChild(container)
8 |
9 | return new Vue({
10 | el: '#app',
11 | render: h => h(App)
12 | })
13 | }
14 |
--------------------------------------------------------------------------------
/examples/demo20/src/tree/main.mp.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './App.vue'
3 |
4 | export default function createApp() {
5 | const container = document.createElement('div')
6 | container.id = 'app'
7 | document.body.appendChild(container)
8 |
9 | return new Vue({
10 | el: '#app',
11 | render: h => h(App)
12 | })
13 | }
14 |
--------------------------------------------------------------------------------
/examples/demo20/src/treemap/main.mp.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './App.vue'
3 |
4 | export default function createApp() {
5 | const container = document.createElement('div')
6 | container.id = 'app'
7 | document.body.appendChild(container)
8 |
9 | return new Vue({
10 | el: '#app',
11 | render: h => h(App)
12 | })
13 | }
14 |
--------------------------------------------------------------------------------
/examples/demo21/mp/app.wxss:
--------------------------------------------------------------------------------
1 | /**app.wxss**/
2 | .container {
3 | height: 100%;
4 | display: flex;
5 | flex-direction: column;
6 | align-items: center;
7 | justify-content: space-between;
8 | padding: 200rpx 0;
9 | box-sizing: border-box;
10 | }
11 |
--------------------------------------------------------------------------------
/examples/demo21/mp/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "miniprogram-project",
3 | "version": "0.0.1",
4 | "description": "miniprogram project",
5 | "dependencies": {
6 | "miniprogram-render": "latest",
7 | "miniprogram-element": "latest"
8 | },
9 | "author": "wechat-miniprogram"
10 | }
--------------------------------------------------------------------------------
/examples/demo21/mp/pages/index/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {}
3 | }
--------------------------------------------------------------------------------
/examples/demo21/mp/pages/index/index.wxss:
--------------------------------------------------------------------------------
1 | /**index.wxss**/
2 | .userinfo {
3 | display: flex;
4 | flex-direction: column;
5 | align-items: center;
6 | }
7 |
8 | .userinfo-avatar {
9 | width: 128rpx;
10 | height: 128rpx;
11 | margin: 20rpx;
12 | border-radius: 50%;
13 | }
14 |
15 | .userinfo-nickname {
16 | color: #aaa;
17 | }
18 |
19 | .usermotto {
20 | margin-top: 200px;
21 | }
--------------------------------------------------------------------------------
/examples/demo21/mp/sitemap.json:
--------------------------------------------------------------------------------
1 | {
2 | "desc": "关于本文件的更多信息,请参考文档 https://developers.weixin.qq.com/miniprogram/dev/framework/sitemap.html",
3 | "rules": [{
4 | "action": "allow",
5 | "page": "*"
6 | }]
7 | }
--------------------------------------------------------------------------------
/examples/demo21/mp/utils/util.js:
--------------------------------------------------------------------------------
1 | const formatTime = date => {
2 | const year = date.getFullYear()
3 | const month = date.getMonth() + 1
4 | const day = date.getDate()
5 | const hour = date.getHours()
6 | const minute = date.getMinutes()
7 | const second = date.getSeconds()
8 |
9 | return [year, month, day].map(formatNumber).join('/') + ' ' + [hour, minute, second].map(formatNumber).join(':')
10 | }
11 |
12 | const formatNumber = n => {
13 | n = n.toString()
14 | return n[1] ? n : '0' + n
15 | }
16 |
17 | module.exports = {
18 | formatTime: formatTime
19 | }
20 |
--------------------------------------------------------------------------------
/examples/demo21/src/common/Footer.vue:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
10 |
11 |
18 |
--------------------------------------------------------------------------------
/examples/demo21/src/common/Header.vue:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
10 |
11 |
18 |
--------------------------------------------------------------------------------
/examples/demo21/src/page1/main.mp.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './App.vue'
3 |
4 | export default function createApp() {
5 | const container = document.createElement('div')
6 | container.id = 'app'
7 | document.body.appendChild(container)
8 |
9 | return new Vue({
10 | el: '#app',
11 | render: h => h(App)
12 | })
13 | }
14 |
--------------------------------------------------------------------------------
/examples/demo21/src/page2/main.mp.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './App.vue'
3 |
4 | export default function createApp() {
5 | const container = document.createElement('div')
6 | container.id = 'app'
7 | document.body.appendChild(container)
8 |
9 | return new Vue({
10 | el: '#app',
11 | render: h => h(App)
12 | })
13 | }
14 |
--------------------------------------------------------------------------------
/examples/demo22/build/miniprogram.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | origin: 'https://test.miniprogram.com',
3 | entry: '/',
4 | router: {
5 | page1: ['/'],
6 | page2: ['/page2'],
7 | page3: ['/page3'],
8 | page4: ['/page4'],
9 | },
10 | redirect: {
11 | notFound: 'page1',
12 | accessDenied: 'page1',
13 | },
14 | app: {
15 | navigationBarTitleText: 'miniprogram-project',
16 | },
17 | projectConfig: {
18 | appid: 'wx14c7c4cd189644a1',
19 | projectname: 'kbone-demo22',
20 | },
21 | packageConfig: {
22 | author: 'wechat-miniprogram',
23 | },
24 | }
--------------------------------------------------------------------------------
/examples/demo22/src/common/Footer.vue:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
10 |
11 |
18 |
--------------------------------------------------------------------------------
/examples/demo22/src/common/Header.vue:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
10 |
11 |
18 |
--------------------------------------------------------------------------------
/examples/demo22/src/page1/main.mp.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import {createStore} from '../store'
3 | import App from './App.vue'
4 |
5 | export default function createApp() {
6 | const container = document.createElement('div')
7 | container.id = 'app'
8 | document.body.appendChild(container)
9 |
10 | return new Vue({
11 | el: '#app',
12 | store: createStore(),
13 | render: h => h(App)
14 | })
15 | }
16 |
--------------------------------------------------------------------------------
/examples/demo22/src/page2/main.mp.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import {createStore} from '../store'
3 | import App from './App.vue'
4 |
5 | export default function createApp() {
6 | const container = document.createElement('div')
7 | container.id = 'app'
8 | document.body.appendChild(container)
9 |
10 | return new Vue({
11 | el: '#app',
12 | store: createStore(),
13 | render: h => h(App)
14 | })
15 | }
16 |
--------------------------------------------------------------------------------
/examples/demo22/src/page3/main.mp.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import {createStore} from '../store'
3 | import App from './App.vue'
4 |
5 | export default function createApp() {
6 | const container = document.createElement('div')
7 | container.id = 'app'
8 | document.body.appendChild(container)
9 |
10 | return new Vue({
11 | el: '#app',
12 | store: createStore(),
13 | render: h => h(App)
14 | })
15 | }
16 |
--------------------------------------------------------------------------------
/examples/demo22/src/page4/main.mp.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import {createStore} from '../store'
3 | import App from './App.vue'
4 |
5 | export default function createApp() {
6 | const container = document.createElement('div')
7 | container.id = 'app'
8 | document.body.appendChild(container)
9 |
10 | return new Vue({
11 | el: '#app',
12 | store: createStore(),
13 | render: h => h(App)
14 | })
15 | }
16 |
--------------------------------------------------------------------------------
/examples/demo23/build/miniprogram.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | origin: 'https://test.miniprogram.com',
3 | entry: '/test',
4 | router: {
5 | index: ['/test'],
6 | },
7 | redirect: {
8 | notFound: 'index',
9 | accessDenied: 'index',
10 | },
11 | app: {
12 | navigationBarTitleText: 'miniprogram-project',
13 | },
14 | pages: {
15 | index: {
16 | defaultTargetUrl: '/test#/ccc'
17 | },
18 | },
19 | projectConfig: {
20 | appid: 'wx14c7c4cd189644a1',
21 | projectname: 'kbone-demo23',
22 | },
23 | packageConfig: {
24 | author: 'wechat-miniprogram',
25 | },
26 | }
--------------------------------------------------------------------------------
/examples/demo23/src/common/Footer.vue:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
10 |
11 |
18 |
--------------------------------------------------------------------------------
/examples/demo23/src/index/AAA.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
I am aaa
4 |
route: {{route}}
5 |
6 |
7 |
8 |
18 |
19 |
25 |
--------------------------------------------------------------------------------
/examples/demo23/src/index/BBB.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
I am bbb
4 |
route: {{route}}
5 |
6 |
7 |
8 |
18 |
19 |
25 |
--------------------------------------------------------------------------------
/examples/demo23/src/index/CCC.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
I am ccc
4 |
route: {{route}}
5 |
6 |
7 |
8 |
18 |
19 |
25 |
--------------------------------------------------------------------------------
/examples/demo24/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": [
3 | "env",
4 | "stage-3",
5 | "react"
6 | ]
7 | }
--------------------------------------------------------------------------------
/examples/demo24/build/miniprogram.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | origin: 'https://test.miniprogram.com',
3 | entry: '/',
4 | router: {
5 | page1: ['/a'],
6 | page2: ['/b'],
7 | page3: ['/c'],
8 | },
9 | redirect: {
10 | notFound: 'page1',
11 | accessDenied: 'page1',
12 | },
13 | runtime: {
14 | cookieStore: 'globalstorage',
15 | },
16 | app: {
17 | navigationBarTitleText: 'miniprogram-project',
18 | },
19 | projectConfig: {
20 | appid: 'wx14c7c4cd189644a1',
21 | projectname: 'kbone-demo24',
22 | },
23 | packageConfig: {
24 | author: 'wechat-miniprogram',
25 | },
26 | }
--------------------------------------------------------------------------------
/examples/demo24/src/common/Footer.css:
--------------------------------------------------------------------------------
1 | .footer {
2 | margin-top: 10px;
3 | width: 100%;
4 | text-align: center;
5 | }
--------------------------------------------------------------------------------
/examples/demo24/src/common/Footer.jsx:
--------------------------------------------------------------------------------
1 | import React, {useState} from 'react'
2 | import {render, h} from 'react-dom'
3 | import './Footer.css'
4 |
5 | const Footer = (props, store) => {
6 | return (
7 |
8 |
wechat-miniprogram
9 |
10 | )
11 | }
12 |
13 | export default Footer
14 |
--------------------------------------------------------------------------------
/examples/demo24/src/common/Header.css:
--------------------------------------------------------------------------------
1 | .header {
2 | margin-bottom: 10px;
3 | width: 100%;
4 | text-align: center;
5 | }
--------------------------------------------------------------------------------
/examples/demo24/src/common/Header.jsx:
--------------------------------------------------------------------------------
1 | import React, {useState} from 'react'
2 | import {render, h} from 'react-dom'
3 | import './Header.css'
4 |
5 | const Header = (props, store) => {
6 | return (
7 |
8 |
wechat-miniprogram
9 |
10 | )
11 | }
12 |
13 | export default Header
14 |
--------------------------------------------------------------------------------
/examples/demo24/src/page1/App.css:
--------------------------------------------------------------------------------
1 | .cnt {
2 | margin-top: 20px;
3 | }
4 | a, button {
5 | display: block;
6 | width: 100%;
7 | height: 30px;
8 | line-height: 30px;
9 | text-align: center;
10 | font-size: 20px;
11 | border: 1px solid #ddd;
12 | }
--------------------------------------------------------------------------------
/examples/demo24/src/page1/main.jsx:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import {render, h} from 'react-dom'
3 | import App from './app'
4 |
5 | render(, document.getElementById('app'))
6 |
--------------------------------------------------------------------------------
/examples/demo24/src/page1/main.mp.jsx:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import {render, h} from 'react-dom'
3 | import App from './App'
4 |
5 | export default function createApp() {
6 | const container = document.createElement('div')
7 | container.id = 'app'
8 | document.body.appendChild(container)
9 |
10 | render(, container)
11 | }
12 |
--------------------------------------------------------------------------------
/examples/demo24/src/page2/App.css:
--------------------------------------------------------------------------------
1 | .cnt {
2 | margin-top: 20px;
3 | }
4 | a, button {
5 | display: block;
6 | width: 100%;
7 | height: 30px;
8 | line-height: 30px;
9 | text-align: center;
10 | font-size: 20px;
11 | border: 1px solid #ddd;
12 | }
--------------------------------------------------------------------------------
/examples/demo24/src/page2/main.jsx:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import {render, h} from 'react-dom'
3 | import App from './app'
4 |
5 | render(, document.getElementById('app'))
6 |
--------------------------------------------------------------------------------
/examples/demo24/src/page2/main.mp.jsx:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import {render, h} from 'react-dom'
3 | import App from './App'
4 |
5 | export default function createApp() {
6 | const container = document.createElement('div')
7 | container.id = 'app'
8 | document.body.appendChild(container)
9 |
10 | render(, container)
11 | }
12 |
--------------------------------------------------------------------------------
/examples/demo24/src/page3/App.css:
--------------------------------------------------------------------------------
1 | .cnt {
2 | margin-top: 20px;
3 | }
4 | a, button {
5 | display: block;
6 | width: 100%;
7 | height: 30px;
8 | line-height: 30px;
9 | text-align: center;
10 | font-size: 20px;
11 | border: 1px solid #ddd;
12 | }
--------------------------------------------------------------------------------
/examples/demo24/src/page3/App.jsx:
--------------------------------------------------------------------------------
1 | import React, {useState} from 'react'
2 | import {render, h} from 'react-dom'
3 | import './App.css'
4 |
5 | import Header from '../common/Header'
6 | import Footer from '../common/Footer'
7 |
8 | const App = (props, store) => {
9 | function onClickBack() {
10 | wx.navigateBack()
11 | }
12 |
13 | return (
14 |
15 |
16 |
17 |
18 |
19 | )
20 | }
21 |
22 | export default App
23 |
--------------------------------------------------------------------------------
/examples/demo24/src/page3/main.jsx:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import {render, h} from 'react-dom'
3 | import App from './app'
4 |
5 | render(, document.getElementById('app'))
6 |
--------------------------------------------------------------------------------
/examples/demo24/src/page3/main.mp.jsx:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import {render, h} from 'react-dom'
3 | import App from './App'
4 |
5 | export default function createApp() {
6 | const container = document.createElement('div')
7 | container.id = 'app'
8 | document.body.appendChild(container)
9 |
10 | render(, container)
11 | }
12 |
--------------------------------------------------------------------------------
/examples/demo25/src/common/Footer.vue:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
10 |
11 |
18 |
--------------------------------------------------------------------------------
/examples/demo25/src/common/Header.vue:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
10 |
11 |
18 |
--------------------------------------------------------------------------------
/examples/demo25/src/page1/main.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './App.vue'
3 |
4 | new Vue({
5 | el: '#app',
6 | render: h => h(App)
7 | })
8 |
--------------------------------------------------------------------------------
/examples/demo25/src/page1/main.mp.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './App.vue'
3 |
4 | export default function createApp() {
5 | const container = document.createElement('div')
6 | container.id = 'app'
7 | document.body.appendChild(container)
8 |
9 | return new Vue({
10 | el: '#app',
11 | render: h => h(App)
12 | })
13 | }
14 |
--------------------------------------------------------------------------------
/examples/demo25/src/page2/main.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './App.vue'
3 |
4 | new Vue({
5 | el: '#app',
6 | render: h => h(App)
7 | })
8 |
--------------------------------------------------------------------------------
/examples/demo25/src/page2/main.mp.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './App.vue'
3 |
4 | export default function createApp() {
5 | const container = document.createElement('div')
6 | container.id = 'app'
7 | document.body.appendChild(container)
8 |
9 | return new Vue({
10 | el: '#app',
11 | render: h => h(App)
12 | })
13 | }
14 |
--------------------------------------------------------------------------------
/examples/demo25/src/page3/main.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './App.vue'
3 |
4 | new Vue({
5 | el: '#app',
6 | render: h => h(App)
7 | })
8 |
--------------------------------------------------------------------------------
/examples/demo25/src/page3/main.mp.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './App.vue'
3 |
4 | export default function createApp() {
5 | const container = document.createElement('div')
6 | container.id = 'app'
7 | document.body.appendChild(container)
8 |
9 | return new Vue({
10 | el: '#app',
11 | render: h => h(App)
12 | })
13 | }
14 |
--------------------------------------------------------------------------------
/examples/demo25/src/worker/sharedWorker.js:
--------------------------------------------------------------------------------
1 | let count = 0
2 |
3 | onconnect = evt => {
4 | const port = evt.ports[0]
5 |
6 | port.addEventListener('message', evt => {
7 | count++
8 | console.log(`sharedWorker receive message(${count}): `, evt, evt.data)
9 | port.postMessage({from: 'sharedWorker', to: evt.data.from, count})
10 | })
11 |
12 | port.start()
13 | }
14 |
--------------------------------------------------------------------------------
/examples/demo25/src/worker/worker.js:
--------------------------------------------------------------------------------
1 | let count = 0
2 |
3 | onmessage = evt => {
4 | count++
5 | if (count === 1) {
6 | console.log('navigator: ', navigator)
7 | console.log('location: ', location)
8 | }
9 | console.log(`worker receive message(${count}): `, evt, evt.data)
10 | postMessage({from: 'worker', to: evt.data.from, count})
11 | }
12 |
--------------------------------------------------------------------------------
/examples/demo26/src/common/Footer.vue:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
10 |
11 |
18 |
--------------------------------------------------------------------------------
/examples/demo26/src/common/Header.vue:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
10 |
11 |
18 |
--------------------------------------------------------------------------------
/examples/demo26/src/page1/main.mp.js:
--------------------------------------------------------------------------------
1 | import * as Vue from 'vue'
2 | import App from './App.vue'
3 |
4 | export default function createApp() {
5 | const container = document.createElement('div')
6 | container.id = 'app'
7 | document.body.appendChild(container)
8 |
9 | const app = Vue.createApp(App)
10 | app.mount('#app')
11 | return app
12 | }
13 |
--------------------------------------------------------------------------------
/examples/demo26/src/page2/main.mp.js:
--------------------------------------------------------------------------------
1 | import * as Vue from 'vue'
2 | import App from './App.vue'
3 |
4 | export default function createApp() {
5 | const container = document.createElement('div')
6 | container.id = 'app'
7 | document.body.appendChild(container)
8 |
9 | const app = Vue.createApp(App)
10 | app.mount('#app')
11 | return app
12 | }
13 |
--------------------------------------------------------------------------------
/examples/demo26/src/page3/main.mp.js:
--------------------------------------------------------------------------------
1 | import * as Vue from 'vue'
2 | import App from './App.vue'
3 |
4 | export default function createApp() {
5 | const container = document.createElement('div')
6 | container.id = 'app'
7 | document.body.appendChild(container)
8 |
9 | const app = Vue.createApp(App)
10 | app.mount('#app')
11 | return app
12 | }
13 |
--------------------------------------------------------------------------------
/examples/demo27/src/index/main.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './App.vue'
3 | import VConsole from 'vconsole'
4 | // import KBoneUI from 'kbone-ui' // 引入完整 kbone-ui
5 | import KBoneUI from 'kbone-ui/wx-components' // 只引入内置组件
6 |
7 | KBoneUI.register({
8 | style: {
9 | 'wx-input': `.green {color: green;}`, // 注入给 placeholder-class 使用
10 | 'wx-textarea': `.green {color: green;}`, // 注入给 placeholder-class 使用
11 | }
12 | })
13 |
14 | new VConsole()
15 |
16 | new Vue({
17 | el: '#app',
18 | render: h => h(App)
19 | })
20 |
--------------------------------------------------------------------------------
/examples/demo27/src/index/main.mp.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './App.vue'
3 |
4 | export default function createApp() {
5 | const container = document.createElement('div')
6 | container.id = 'app'
7 | document.body.appendChild(container)
8 |
9 | return new Vue({
10 | el: '#app',
11 | render: h => h(App)
12 | })
13 | }
14 |
--------------------------------------------------------------------------------
/examples/demo28/build/miniprogram.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | origin: 'https://test.miniprogram.com',
3 | entry: '/',
4 | router: {
5 | index: ['/'],
6 | },
7 | redirect: {
8 | notFound: 'index',
9 | accessDenied: 'index',
10 | },
11 | generate: {
12 | weui: true,
13 | appWxss: 'display',
14 | },
15 | app: {
16 | navigationStyle: "custom",
17 | navigationBarTitleText: 'miniprogram-project',
18 | },
19 | projectConfig: {
20 | appid: 'wx14c7c4cd189644a1',
21 | projectname: 'kbone-demo28',
22 | },
23 | packageConfig: {
24 | author: 'wechat-miniprogram',
25 | },
26 | }
--------------------------------------------------------------------------------
/examples/demo28/src/index/main.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './App.vue'
3 | import VConsole from 'vconsole'
4 | import KBoneUI from 'kbone-ui' // 引入完整 kbone-ui
5 |
6 | KBoneUI.register({
7 | style: {
8 | 'mp-badge': `.blue {background: blue;}`,
9 | 'mp-loading': `.demo0 {height: 60px; background: white;} .demo1 {height: 60px; background: rgba(0,0,0,.1);}`,
10 | 'mp-searchbar': `.searchbar-result {margin-top: 0;font-size: 14px;} .searchbar-result:before {display: none;}`
11 | }
12 | })
13 |
14 | new VConsole()
15 |
16 | new Vue({
17 | el: '#app',
18 | render: h => h(App)
19 | })
20 |
--------------------------------------------------------------------------------
/examples/demo28/src/index/main.mp.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './App.vue'
3 | import * as kbone from 'kbone-tool'
4 |
5 | // relations 不支持跨自定义组件,得在逻辑层解决
6 | kbone.weui.useForm()
7 |
8 | export default function createApp() {
9 | const container = document.createElement('div')
10 | container.id = 'app'
11 | document.body.appendChild(container)
12 |
13 | return new Vue({
14 | el: '#app',
15 | render: h => h(App)
16 | })
17 | }
18 |
--------------------------------------------------------------------------------
/examples/demo29/build/miniprogram.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | origin: 'https://test.miniprogram.com',
3 | entry: '/',
4 | redirect: {
5 | notFound: 'index',
6 | accessDenied: 'index',
7 | },
8 | app: {
9 | navigationBarTitleText: 'miniprogram-project',
10 | },
11 | global: {
12 | rem: true, // 是否支持 rem
13 | pageStyle: true, // 是否支持修改页面样式
14 | },
15 | projectConfig: {
16 | appid: 'wx14c7c4cd189644a1',
17 | projectname: 'kbone-demo29',
18 | },
19 | packageConfig: {
20 | author: 'wechat-miniprogram',
21 | },
22 | }
--------------------------------------------------------------------------------
/examples/demo29/src/common/Footer.vue:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
10 |
11 |
18 |
--------------------------------------------------------------------------------
/examples/demo29/src/index/main.mp.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './App.vue'
3 |
4 | export default function createApp() {
5 | const container = document.createElement('div')
6 | container.id = 'app'
7 | document.body.appendChild(container)
8 |
9 |
10 | return new Vue({
11 | el: '#app',
12 | render: h => h(App)
13 | })
14 | }
15 |
--------------------------------------------------------------------------------
/examples/demo3/src/index/imgs/location.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tencent/kbone/55fa1e27295b8b26e43c1487167ea07345eb88a2/examples/demo3/src/index/imgs/location.png
--------------------------------------------------------------------------------
/examples/demo3/src/index/imgs/voice.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tencent/kbone/55fa1e27295b8b26e43c1487167ea07345eb88a2/examples/demo3/src/index/imgs/voice.png
--------------------------------------------------------------------------------
/examples/demo3/src/index/main.mp.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './App.vue'
3 |
4 | export default function createApp() {
5 | const container = document.createElement('div')
6 | container.id = 'app'
7 | document.body.appendChild(container)
8 |
9 | return new Vue({
10 | el: '#app',
11 | render: h => h(App)
12 | })
13 | }
14 |
--------------------------------------------------------------------------------
/examples/demo3/src/loading-view/loading.js:
--------------------------------------------------------------------------------
1 | Component({
2 | properties: {
3 | pageName: {
4 | type: String,
5 | value: '',
6 | },
7 | },
8 |
9 | attached() {
10 | console.log('page name: ', this.data.pageName)
11 | },
12 | })
--------------------------------------------------------------------------------
/examples/demo3/src/loading-view/loading.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {}
4 | }
--------------------------------------------------------------------------------
/examples/demo3/src/loading-view/loading.wxml:
--------------------------------------------------------------------------------
1 | 加载中...
--------------------------------------------------------------------------------
/examples/demo3/src/loading-view/loading.wxss:
--------------------------------------------------------------------------------
1 | .loading {
2 | display: flex;
3 | align-items: center;
4 | justify-content: center;
5 | width: 100%;
6 | height: 100%;
7 | }
--------------------------------------------------------------------------------
/examples/demo3/src/page-container/main.mp.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './App.vue'
3 |
4 | export default function createApp() {
5 | const container = document.createElement('div')
6 | container.id = 'app'
7 | document.body.appendChild(container)
8 |
9 | return new Vue({
10 | el: '#app',
11 | render: h => h(App)
12 | })
13 | }
14 |
--------------------------------------------------------------------------------
/examples/demo30/build/miniprogram.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | origin: 'https://test.miniprogram.com',
3 | entry: '/',
4 | router: {
5 | page1: ['/a'],
6 | page2: ['/b'],
7 | page3: ['/c'],
8 | },
9 | redirect: {
10 | notFound: 'page1',
11 | accessDenied: 'page1',
12 | },
13 | app: {
14 | navigationBarTitleText: 'miniprogram-project',
15 | },
16 | projectConfig: {
17 | appid: 'wx14c7c4cd189644a1',
18 | projectname: 'kbone-demo30',
19 | },
20 | packageConfig: {
21 | author: 'wechat-miniprogram',
22 | },
23 | }
--------------------------------------------------------------------------------
/examples/demo30/src/common/Footer.vue:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
10 |
11 |
18 |
--------------------------------------------------------------------------------
/examples/demo30/src/common/Header.vue:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
10 |
11 |
18 |
--------------------------------------------------------------------------------
/examples/demo30/src/page1/main.mp.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './App.vue'
3 |
4 | export default function createApp() {
5 | const container = document.createElement('div')
6 | container.id = 'app'
7 | document.body.appendChild(container)
8 |
9 | return new Vue({
10 | el: '#app',
11 | render: h => h(App)
12 | })
13 | }
14 |
--------------------------------------------------------------------------------
/examples/demo30/src/page2/main.mp.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './App.vue'
3 |
4 | export default function createApp() {
5 | const container = document.createElement('div')
6 | container.id = 'app'
7 | document.body.appendChild(container)
8 |
9 | return new Vue({
10 | el: '#app',
11 | render: h => h(App)
12 | })
13 | }
14 |
--------------------------------------------------------------------------------
/examples/demo30/src/page3/main.mp.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './App.vue'
3 |
4 | export default function createApp() {
5 | const container = document.createElement('div')
6 | container.id = 'app'
7 | document.body.appendChild(container)
8 |
9 | return new Vue({
10 | el: '#app',
11 | render: h => h(App)
12 | })
13 | }
14 |
--------------------------------------------------------------------------------
/examples/demo31/build/miniprogram.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | origin: 'https://test.miniprogram.com',
3 | entry: '/',
4 | router: {
5 | index: ['/'],
6 | },
7 | app: {
8 | navigationBarTitleText: 'miniprogram-project',
9 | },
10 | projectConfig: {
11 | appid: 'wx14c7c4cd189644a1',
12 | projectname: 'kbone-demo31',
13 | },
14 | packageConfig: {
15 | author: 'wechat-miniprogram',
16 | },
17 | }
--------------------------------------------------------------------------------
/examples/demo32/mp/app.js:
--------------------------------------------------------------------------------
1 | App({})
2 |
--------------------------------------------------------------------------------
/examples/demo32/mp/app.wxss:
--------------------------------------------------------------------------------
1 | .container {
2 | height: 100%;
3 | display: flex;
4 | flex-direction: column;
5 | align-items: center;
6 | justify-content: space-between;
7 | padding: 200rpx 0;
8 | box-sizing: border-box;
9 | }
10 |
--------------------------------------------------------------------------------
/examples/demo32/mp/img/page-sel.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tencent/kbone/55fa1e27295b8b26e43c1487167ea07345eb88a2/examples/demo32/mp/img/page-sel.png
--------------------------------------------------------------------------------
/examples/demo32/mp/img/page.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tencent/kbone/55fa1e27295b8b26e43c1487167ea07345eb88a2/examples/demo32/mp/img/page.png
--------------------------------------------------------------------------------
/examples/demo32/mp/kbone/common/default~page2~page3~page4.wxss:
--------------------------------------------------------------------------------
1 | .header{margin-bottom:10px}.footer,.header{width:100%;text-align:center}.footer{margin-top:10px}
--------------------------------------------------------------------------------
/examples/demo32/mp/kbone/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "miniprogram-project",
3 | "version": "0.0.1",
4 | "description": "miniprogram project",
5 | "dependencies": {
6 | "miniprogram-render": "latest",
7 | "miniprogram-element": "latest"
8 | },
9 | "author": "wechat-miniprogram"
10 | }
--------------------------------------------------------------------------------
/examples/demo32/mp/kbone/package1/common/page2.wxss:
--------------------------------------------------------------------------------
1 | .cnt{margin-top:20px}.h5-a,.h5-button{display:block;width:100%;height:30px;line-height:30px;text-align:center;font-size:20px;border:1px solid #ddd}
--------------------------------------------------------------------------------
/examples/demo32/mp/kbone/package1/pages/page2/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "enablePullDownRefresh": false,
3 | "usingComponents": {
4 | "element": "miniprogram-element"
5 | }
6 | }
--------------------------------------------------------------------------------
/examples/demo32/mp/kbone/package1/pages/page2/index.wxml:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/examples/demo32/mp/kbone/package1/pages/page2/index.wxss:
--------------------------------------------------------------------------------
1 | @import "../../../common/default~page2~page3~page4.wxss";
2 | @import "../../common/page2.wxss";
--------------------------------------------------------------------------------
/examples/demo32/mp/kbone/package2/common/page3.wxss:
--------------------------------------------------------------------------------
1 | .cnt{margin-top:20px}.h5-a,.h5-button{display:block;width:100%;height:30px;line-height:30px;text-align:center;font-size:20px;border:1px solid #ddd}
--------------------------------------------------------------------------------
/examples/demo32/mp/kbone/package2/common/page4.wxss:
--------------------------------------------------------------------------------
1 | .cnt,.tabbar{margin-top:20px}.tabbar{padding:0;width:100%;display:flex;list-style:none;justify-content:center}.tabbar .h5-li{position:relative;display:block;height:50px;width:80px;text-align:center;line-height:50px;background:#dff1e7;margin:5px}.tabbar .h5-li .link{display:block;width:100%;height:100%}.cnt{width:100%;text-align:center}
--------------------------------------------------------------------------------
/examples/demo32/mp/kbone/package2/pages/page3/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "enablePullDownRefresh": false,
3 | "usingComponents": {
4 | "element": "miniprogram-element"
5 | }
6 | }
--------------------------------------------------------------------------------
/examples/demo32/mp/kbone/package2/pages/page3/index.wxml:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/examples/demo32/mp/kbone/package2/pages/page3/index.wxss:
--------------------------------------------------------------------------------
1 | @import "../../../common/default~page2~page3~page4.wxss";
2 | @import "../../common/page3.wxss";
--------------------------------------------------------------------------------
/examples/demo32/mp/kbone/package2/pages/page4/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "enablePullDownRefresh": false,
3 | "usingComponents": {
4 | "element": "miniprogram-element"
5 | }
6 | }
--------------------------------------------------------------------------------
/examples/demo32/mp/kbone/package2/pages/page4/index.wxml:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/examples/demo32/mp/kbone/package2/pages/page4/index.wxss:
--------------------------------------------------------------------------------
1 | @import "../../../common/default~page2~page3~page4.wxss";
2 | @import "../../common/page4.wxss";
--------------------------------------------------------------------------------
/examples/demo32/mp/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "miniprogram-project",
3 | "version": "0.0.1",
4 | "description": "miniprogram project",
5 | "dependencies": {
6 | "miniprogram-render": "latest",
7 | "miniprogram-element": "latest"
8 | },
9 | "author": "wechat-miniprogram"
10 | }
--------------------------------------------------------------------------------
/examples/demo32/mp/pages/index/index.js:
--------------------------------------------------------------------------------
1 | Page({
2 | page2() {
3 | wx.switchTab({
4 | url: '/pages/index2/index',
5 | })
6 | },
7 |
8 | page3() {
9 | wx.switchTab({
10 | url: '/pages/index3/index',
11 | })
12 | },
13 |
14 | page4() {
15 | wx.navigateTo({
16 | url: `/pages/index4/index?type=open&targeturl=${encodeURIComponent('/spa')}`,
17 | })
18 | },
19 | })
20 |
--------------------------------------------------------------------------------
/examples/demo32/mp/pages/index/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {}
3 | }
--------------------------------------------------------------------------------
/examples/demo32/mp/pages/index/index.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/examples/demo32/mp/pages/index/index.wxss:
--------------------------------------------------------------------------------
1 | button {
2 | margin-bottom: 20px;
3 | }
--------------------------------------------------------------------------------
/examples/demo32/mp/pages/index2/index.js:
--------------------------------------------------------------------------------
1 | Page({
2 | data: {
3 | route: '',
4 | },
5 | onPageScroll(options) {
6 | if (!this.kbonePage) {
7 | this.kbonePage = this.selectComponent('#kbone-page')
8 | }
9 |
10 | if (this.kbonePage) {
11 | this.kbonePage.onPageScroll(options)
12 | }
13 | },
14 | onTap() {
15 | this.setData({
16 | route: this.route,
17 | })
18 | },
19 | })
20 |
--------------------------------------------------------------------------------
/examples/demo32/mp/pages/index2/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {
3 | "kbone-page": "/kbone/package1/pages/page2/index"
4 | },
5 | "componentPlaceholder": {
6 | "kbone-page": "view"
7 | }
8 | }
--------------------------------------------------------------------------------
/examples/demo32/mp/pages/index2/index.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/examples/demo32/mp/pages/index2/index.wxss:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tencent/kbone/55fa1e27295b8b26e43c1487167ea07345eb88a2/examples/demo32/mp/pages/index2/index.wxss
--------------------------------------------------------------------------------
/examples/demo32/mp/pages/index3/index.js:
--------------------------------------------------------------------------------
1 | Page({
2 | data: {
3 | route: '',
4 | },
5 | onLoad() {
6 | this.setData({
7 | route: this.route,
8 | })
9 | },
10 | })
11 |
--------------------------------------------------------------------------------
/examples/demo32/mp/pages/index3/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {
3 | "kbone-page": "/kbone/package2/pages/page3/index"
4 | },
5 | "componentPlaceholder": {
6 | "kbone-page": "view"
7 | }
8 | }
--------------------------------------------------------------------------------
/examples/demo32/mp/pages/index3/index.wxml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/examples/demo32/mp/pages/index3/index.wxss:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tencent/kbone/55fa1e27295b8b26e43c1487167ea07345eb88a2/examples/demo32/mp/pages/index3/index.wxss
--------------------------------------------------------------------------------
/examples/demo32/mp/pages/index4/index.js:
--------------------------------------------------------------------------------
1 | Page({
2 | data: {
3 | route: '',
4 | params: {
5 | type: 'open',
6 | targeturl: encodeURIComponent('/spa'),
7 | },
8 | },
9 | onLoad(args) {
10 | this.setData({
11 | route: this.route,
12 | params: {
13 | type: args.type || 'open',
14 | targeturl: args.targeturl || encodeURIComponent('/spa'),
15 | },
16 | })
17 | },
18 | })
19 |
--------------------------------------------------------------------------------
/examples/demo32/mp/pages/index4/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {
3 | "kbone-page": "/kbone/package2/pages/page4/index"
4 | },
5 | "componentPlaceholder": {
6 | "kbone-page": "view"
7 | }
8 | }
--------------------------------------------------------------------------------
/examples/demo32/mp/pages/index4/index.wxml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/examples/demo32/mp/pages/index4/index.wxss:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tencent/kbone/55fa1e27295b8b26e43c1487167ea07345eb88a2/examples/demo32/mp/pages/index4/index.wxss
--------------------------------------------------------------------------------
/examples/demo32/mp/sitemap.json:
--------------------------------------------------------------------------------
1 | {
2 | "desc": "关于本文件的更多信息,请参考文档 https://developers.weixin.qq.com/miniprogram/dev/framework/sitemap.html",
3 | "rules": [{
4 | "action": "allow",
5 | "page": "*"
6 | }]
7 | }
--------------------------------------------------------------------------------
/examples/demo32/mp/utils/util.js:
--------------------------------------------------------------------------------
1 | const formatTime = date => {
2 | const year = date.getFullYear()
3 | const month = date.getMonth() + 1
4 | const day = date.getDate()
5 | const hour = date.getHours()
6 | const minute = date.getMinutes()
7 | const second = date.getSeconds()
8 |
9 | return [year, month, day].map(formatNumber).join('/') + ' ' + [hour, minute, second].map(formatNumber).join(':')
10 | }
11 |
12 | const formatNumber = n => {
13 | n = n.toString()
14 | return n[1] ? n : '0' + n
15 | }
16 |
17 | module.exports = {
18 | formatTime: formatTime
19 | }
20 |
--------------------------------------------------------------------------------
/examples/demo32/src/app.css:
--------------------------------------------------------------------------------
1 | .header {
2 | color: #888;
3 | }
4 |
--------------------------------------------------------------------------------
/examples/demo32/src/common/Footer.vue:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
10 |
11 |
18 |
--------------------------------------------------------------------------------
/examples/demo32/src/common/Header.vue:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
10 |
11 |
18 |
--------------------------------------------------------------------------------
/examples/demo32/src/page2/main.mp.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './App.vue'
3 |
4 | export default function createApp() {
5 | const container = document.createElement('div')
6 | container.id = 'app'
7 | document.body.appendChild(container)
8 |
9 | return new Vue({
10 | el: '#app',
11 | render: h => h(App)
12 | })
13 | }
14 |
--------------------------------------------------------------------------------
/examples/demo32/src/page3/main.mp.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './App.vue'
3 |
4 | export default function createApp() {
5 | const container = document.createElement('div')
6 | container.id = 'app'
7 | document.body.appendChild(container)
8 |
9 | return new Vue({
10 | el: '#app',
11 | render: h => h(App)
12 | })
13 | }
14 |
--------------------------------------------------------------------------------
/examples/demo32/src/page4/App.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
21 |
22 |
27 |
--------------------------------------------------------------------------------
/examples/demo32/src/page4/components/AAA.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
I am aaa
4 |
route: {{route}}
5 |
6 |
7 |
8 |
18 |
19 |
25 |
--------------------------------------------------------------------------------
/examples/demo32/src/page4/components/BBB.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
I am bbb
4 |
route: {{route}}
5 |
6 |
7 |
8 |
18 |
19 |
25 |
--------------------------------------------------------------------------------
/examples/demo32/src/page4/components/Normal.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
I am normal
4 |
route: {{route}}
5 |
6 |
7 |
8 |
18 |
19 |
25 |
--------------------------------------------------------------------------------
/examples/demo33/res/negx.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tencent/kbone/55fa1e27295b8b26e43c1487167ea07345eb88a2/examples/demo33/res/negx.jpg
--------------------------------------------------------------------------------
/examples/demo33/res/negy.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tencent/kbone/55fa1e27295b8b26e43c1487167ea07345eb88a2/examples/demo33/res/negy.jpg
--------------------------------------------------------------------------------
/examples/demo33/res/negz.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tencent/kbone/55fa1e27295b8b26e43c1487167ea07345eb88a2/examples/demo33/res/negz.jpg
--------------------------------------------------------------------------------
/examples/demo33/res/posx.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tencent/kbone/55fa1e27295b8b26e43c1487167ea07345eb88a2/examples/demo33/res/posx.jpg
--------------------------------------------------------------------------------
/examples/demo33/res/posy.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tencent/kbone/55fa1e27295b8b26e43c1487167ea07345eb88a2/examples/demo33/res/posy.jpg
--------------------------------------------------------------------------------
/examples/demo33/res/posz.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tencent/kbone/55fa1e27295b8b26e43c1487167ea07345eb88a2/examples/demo33/res/posz.jpg
--------------------------------------------------------------------------------
/examples/demo33/res/total360.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tencent/kbone/55fa1e27295b8b26e43c1487167ea07345eb88a2/examples/demo33/res/total360.jpg
--------------------------------------------------------------------------------
/examples/demo33/src/index/main.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './App.vue'
3 |
4 | new Vue({
5 | el: '#app',
6 | render: h => h(App)
7 | })
8 |
--------------------------------------------------------------------------------
/examples/demo33/src/index/main.mp.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './App.vue'
3 |
4 | export default function createApp() {
5 | const container = document.createElement('div')
6 | container.id = 'app'
7 | document.body.appendChild(container)
8 |
9 | return new Vue({
10 | el: '#app',
11 | render: h => h(App)
12 | })
13 | }
14 |
--------------------------------------------------------------------------------
/examples/demo33/src/index2/main.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './App.vue'
3 |
4 | new Vue({
5 | el: '#app',
6 | render: h => h(App)
7 | })
8 |
--------------------------------------------------------------------------------
/examples/demo33/src/index2/main.mp.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './App.vue'
3 |
4 | export default function createApp() {
5 | const container = document.createElement('div')
6 | container.id = 'app'
7 | document.body.appendChild(container)
8 |
9 | return new Vue({
10 | el: '#app',
11 | render: h => h(App)
12 | })
13 | }
14 |
--------------------------------------------------------------------------------
/examples/demo34/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": [
3 | "env",
4 | "stage-3",
5 | "react"
6 | ]
7 | }
--------------------------------------------------------------------------------
/examples/demo34/src/custom-components/common/utils.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | getWords() {
3 | return 'Hello, '
4 | },
5 | }
6 |
--------------------------------------------------------------------------------
/examples/demo34/src/custom-components/comp-a.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true
3 | }
--------------------------------------------------------------------------------
/examples/demo34/src/custom-components/comp-a.wxml:
--------------------------------------------------------------------------------
1 | comp-a
2 |
3 | {{prefix}}-{{str}}-{{suffix}}
4 |
5 | testObj: {{testObj.a}} - {{testObj.b}}
6 | testArr: {{item}}
7 | testDefaultVal: {{testDefaultVal}}
8 |
--------------------------------------------------------------------------------
/examples/demo34/src/custom-components/comp-a.wxss:
--------------------------------------------------------------------------------
1 | .prefix, .suffix {
2 | color: green;
3 | }
4 |
5 | .btn {
6 | margin: 15px 0;
7 | display: block;
8 | width: 100%;
9 | height: 30px;
10 | line-height: 30px;
11 | text-align: center;
12 | font-size: 20px;
13 | border: 1px solid #ddd;
14 | }
15 |
--------------------------------------------------------------------------------
/examples/demo34/src/custom-components/comp-b/index.js:
--------------------------------------------------------------------------------
1 | const _ = require('../common/utils')
2 |
3 | Component({
4 | properties: {
5 | prefix: {
6 | type: String,
7 | value: 'defaultPrefix',
8 | },
9 | suffix: {
10 | type: String,
11 | value: 'defaultSuffix',
12 | },
13 | name: {
14 | type: String,
15 | value: '',
16 | },
17 | },
18 | data: {
19 | str: _.getWords() + 'comp-b',
20 | },
21 | })
22 |
--------------------------------------------------------------------------------
/examples/demo34/src/custom-components/comp-b/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true
3 | }
--------------------------------------------------------------------------------
/examples/demo34/src/custom-components/comp-b/index.wxml:
--------------------------------------------------------------------------------
1 | comp-b
2 | {{prefix}}-{{str}}-{{suffix}}-{{name}}
3 |
4 |
--------------------------------------------------------------------------------
/examples/demo34/src/custom-components/comp-b/index.wxss:
--------------------------------------------------------------------------------
1 | .prefix, .suffix {
2 | color: green;
3 | }
4 |
--------------------------------------------------------------------------------
/examples/demo34/src/custom-components/comp-c.js:
--------------------------------------------------------------------------------
1 | Component({})
--------------------------------------------------------------------------------
/examples/demo34/src/custom-components/comp-c.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {
4 | "comp-d": "./comp-d"
5 | }
6 | }
--------------------------------------------------------------------------------
/examples/demo34/src/custom-components/comp-c.wxml:
--------------------------------------------------------------------------------
1 | comp-c
2 |
3 | comp-d slot
4 |
5 |
--------------------------------------------------------------------------------
/examples/demo34/src/custom-components/comp-c.wxss:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tencent/kbone/55fa1e27295b8b26e43c1487167ea07345eb88a2/examples/demo34/src/custom-components/comp-c.wxss
--------------------------------------------------------------------------------
/examples/demo34/src/custom-components/comp-d.js:
--------------------------------------------------------------------------------
1 | Component({})
--------------------------------------------------------------------------------
/examples/demo34/src/custom-components/comp-d.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true
3 | }
--------------------------------------------------------------------------------
/examples/demo34/src/custom-components/comp-d.wxml:
--------------------------------------------------------------------------------
1 | comp-d
2 |
--------------------------------------------------------------------------------
/examples/demo34/src/custom-components/comp-d.wxss:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tencent/kbone/55fa1e27295b8b26e43c1487167ea07345eb88a2/examples/demo34/src/custom-components/comp-d.wxss
--------------------------------------------------------------------------------
/examples/demo34/src/custom-components/comp-e/index.js:
--------------------------------------------------------------------------------
1 | Component({
2 | externalClasses: ['my-class'],
3 | })
4 |
--------------------------------------------------------------------------------
/examples/demo34/src/custom-components/comp-e/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true
3 | }
--------------------------------------------------------------------------------
/examples/demo34/src/custom-components/comp-e/index.wxml:
--------------------------------------------------------------------------------
1 | comp-e
2 | external-classes
3 |
4 |
--------------------------------------------------------------------------------
/examples/demo34/src/custom-components/comp-e/index.wxss:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tencent/kbone/55fa1e27295b8b26e43c1487167ea07345eb88a2/examples/demo34/src/custom-components/comp-e/index.wxss
--------------------------------------------------------------------------------
/examples/demo34/src/index/App.css:
--------------------------------------------------------------------------------
1 | .cnt {
2 | margin: 15px;
3 | }
4 |
5 | .block {
6 | border: 1px solid #ddd;
7 | padding: 15px;
8 | box-sizing: content-box;
9 | display: block;
10 | margin-bottom: 15px;
11 | }
12 |
13 | .btn {
14 | margin-top: 15px;
15 | display: block;
16 | width: 100%;
17 | height: 30px;
18 | line-height: 30px;
19 | text-align: center;
20 | font-size: 20px;
21 | border: 1px solid #ddd;
22 | }
23 |
--------------------------------------------------------------------------------
/examples/demo34/src/index/main.mp.jsx:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import {render, h} from 'react-dom'
3 | import App from './App'
4 |
5 | export default function createApp() {
6 | const container = document.createElement('div')
7 | container.id = 'app'
8 | document.body.appendChild(container)
9 |
10 | render(, container)
11 | }
12 |
--------------------------------------------------------------------------------
/examples/demo34/src/other/App.css:
--------------------------------------------------------------------------------
1 | .cnt {
2 | margin: 15px;
3 | }
4 |
5 | .block {
6 | border: 1px solid #ddd;
7 | padding: 15px;
8 | box-sizing: content-box;
9 | display: block;
10 | margin-bottom: 15px;
11 | }
12 |
13 | .external-red {
14 | color: red;
15 | }
16 |
--------------------------------------------------------------------------------
/examples/demo34/src/other/App.jsx:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import { render, h } from 'react-dom'
3 | import './App.css'
4 |
5 | const App = (props, store) => {
6 | return (
7 |
8 |
kbone
9 |
10 | comp-e slot
11 |
12 |
13 | )
14 | }
15 |
16 | export default App
17 |
--------------------------------------------------------------------------------
/examples/demo34/src/other/main.mp.jsx:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import {render, h} from 'react-dom'
3 | import App from './App'
4 |
5 | export default function createApp() {
6 | const container = document.createElement('div')
7 | container.id = 'app'
8 | document.body.appendChild(container)
9 |
10 | render(, container)
11 | }
12 |
--------------------------------------------------------------------------------
/examples/demo35/src/common/Footer.vue:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
10 |
11 |
18 |
--------------------------------------------------------------------------------
/examples/demo35/src/common/Header.vue:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
10 |
11 |
18 |
--------------------------------------------------------------------------------
/examples/demo35/src/page1/main.mp.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './App.vue'
3 |
4 | export default function createApp() {
5 | const container = document.createElement('div')
6 | container.id = 'app'
7 | document.body.appendChild(container)
8 |
9 | return new Vue({
10 | el: '#app',
11 | render: h => h(App)
12 | })
13 | }
14 |
--------------------------------------------------------------------------------
/examples/demo35/src/page2/main.mp.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './App.vue'
3 |
4 | export default function createApp() {
5 | const container = document.createElement('div')
6 | container.id = 'app'
7 | document.body.appendChild(container)
8 |
9 | return new Vue({
10 | el: '#app',
11 | render: h => h(App)
12 | })
13 | }
14 |
--------------------------------------------------------------------------------
/examples/demo35/src/page3/main.mp.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './App.vue'
3 |
4 | export default function createApp() {
5 | const container = document.createElement('div')
6 | container.id = 'app'
7 | document.body.appendChild(container)
8 |
9 | return new Vue({
10 | el: '#app',
11 | render: h => h(App)
12 | })
13 | }
14 |
--------------------------------------------------------------------------------
/examples/demo4/babel.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | presets: [
3 | '@vue/app'
4 | ]
5 | }
6 |
--------------------------------------------------------------------------------
/examples/demo4/dev.md:
--------------------------------------------------------------------------------
1 | ## 调试指南
2 |
3 | 安装依赖:npm install --save-dev file:../../packages/vue-cli-plugin-kbone
4 | 调用:vue invoke vue-cli-plugin-kbone 生成 miniprogram.config.js
--------------------------------------------------------------------------------
/examples/demo4/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tencent/kbone/55fa1e27295b8b26e43c1487167ea07345eb88a2/examples/demo4/public/favicon.ico
--------------------------------------------------------------------------------
/examples/demo4/src/common/Footer.vue:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
10 |
11 |
18 |
--------------------------------------------------------------------------------
/examples/demo4/src/common/Header.vue:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
16 |
17 |
24 |
--------------------------------------------------------------------------------
/examples/demo4/src/common/utils.js:
--------------------------------------------------------------------------------
1 | export function printf(str) {
2 | console.log('common/utils.js --> ', str)
3 | }
4 |
--------------------------------------------------------------------------------
/examples/demo4/src/page1/main.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './App.vue'
3 |
4 | new Vue({
5 | el: '#app',
6 | render: h => h(App)
7 | })
8 |
--------------------------------------------------------------------------------
/examples/demo4/src/page1/main.mp.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './App.vue'
3 |
4 | Vue.config.productionTip = false
5 |
6 | // 需要将创建根组件实例的逻辑封装成方法
7 | export default function createApp() {
8 | // 在小程序中如果要注入到 id 为 app 的 dom 节点上,需要主动创建
9 | const container = document.createElement('div')
10 | container.id = 'app'
11 | document.body.appendChild(container)
12 |
13 | return new Vue({
14 | render: h => h(App),
15 | }).$mount('#app')
16 | }
17 |
--------------------------------------------------------------------------------
/examples/demo4/src/page2/main.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './App.vue'
3 |
4 | new Vue({
5 | el: '#app',
6 | render: h => h(App)
7 | })
8 |
--------------------------------------------------------------------------------
/examples/demo4/src/page2/main.mp.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './App.vue'
3 |
4 | Vue.config.productionTip = false
5 |
6 | // 需要将创建根组件实例的逻辑封装成方法
7 | export default function createApp() {
8 | // 在小程序中如果要注入到 id 为 app 的 dom 节点上,需要主动创建
9 | const container = document.createElement('div')
10 | container.id = 'app'
11 | document.body.appendChild(container)
12 |
13 | return new Vue({
14 | render: h => h(App),
15 | }).$mount('#app')
16 | }
17 |
--------------------------------------------------------------------------------
/examples/demo4/src/page3/main.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './App.vue'
3 |
4 | new Vue({
5 | el: '#app',
6 | render: h => h(App)
7 | })
8 |
--------------------------------------------------------------------------------
/examples/demo4/src/page3/main.mp.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './App.vue'
3 |
4 | Vue.config.productionTip = false
5 |
6 | // 需要将创建根组件实例的逻辑封装成方法
7 | export default function createApp() {
8 | // 在小程序中如果要注入到 id 为 app 的 dom 节点上,需要主动创建
9 | const container = document.createElement('div')
10 | container.id = 'app'
11 | document.body.appendChild(container)
12 |
13 | return new Vue({
14 | render: h => h(App),
15 | }).$mount('#app')
16 | }
17 |
--------------------------------------------------------------------------------
/examples/demo4/vue.config.js:
--------------------------------------------------------------------------------
1 | const webpack = require('webpack')
2 |
3 | module.exports = {
4 | pages: {
5 | page1: 'src/page1/main.js',
6 | page2: {
7 | entry: 'src/page2/main.js',
8 | },
9 | page3: 'src/page3/main.js',
10 | },
11 | pluginOptions: {
12 | kbone: {
13 | configureWebpack: config => {
14 | config.plugins.push(new webpack.DefinePlugin({
15 | 'INJECT_NAME': '\"juneandgreen\"'
16 | }))
17 | }
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/examples/demo5/src/app.css:
--------------------------------------------------------------------------------
1 | .header {
2 | color: #888;
3 | }
4 |
--------------------------------------------------------------------------------
/examples/demo5/src/common/Footer.vue:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
10 |
11 |
18 |
--------------------------------------------------------------------------------
/examples/demo5/src/common/Header.vue:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
17 |
18 |
25 |
--------------------------------------------------------------------------------
/examples/demo5/src/common/utils.js:
--------------------------------------------------------------------------------
1 | export function printf(str) {
2 | console.log('common/utils.js --> ', str)
3 | }
4 |
--------------------------------------------------------------------------------
/examples/demo5/src/page1/main.mp.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './App.vue'
3 |
4 | export default function createApp() {
5 | const container = document.createElement('div')
6 | container.id = 'app'
7 | document.body.appendChild(container)
8 |
9 | return new Vue({
10 | el: '#app',
11 | render: h => h(App)
12 | })
13 | }
14 |
--------------------------------------------------------------------------------
/examples/demo5/src/page2/main.mp.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './App.vue'
3 |
4 | export default function createApp() {
5 | const container = document.createElement('div')
6 | container.id = 'app'
7 | document.body.appendChild(container)
8 |
9 | return new Vue({
10 | el: '#app',
11 | render: h => h(App)
12 | })
13 | }
14 |
--------------------------------------------------------------------------------
/examples/demo5/src/page3/main.mp.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './App.vue'
3 |
4 | export default function createApp() {
5 | const container = document.createElement('div')
6 | container.id = 'app'
7 | document.body.appendChild(container)
8 |
9 | return new Vue({
10 | el: '#app',
11 | render: h => h(App)
12 | })
13 | }
14 |
--------------------------------------------------------------------------------
/examples/demo5/src/page4/App.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
21 |
22 |
27 |
--------------------------------------------------------------------------------
/examples/demo5/src/page4/components/AAA.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
I am aaa
4 |
route: {{route}}
5 |
6 |
7 |
8 |
18 |
19 |
25 |
--------------------------------------------------------------------------------
/examples/demo5/src/page4/components/BBB.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
I am bbb
4 |
route: {{route}}
5 |
6 |
7 |
8 |
18 |
19 |
25 |
--------------------------------------------------------------------------------
/examples/demo5/src/page4/components/Normal.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
I am normal
4 |
route: {{route}}
5 |
6 |
7 |
8 |
18 |
19 |
25 |
--------------------------------------------------------------------------------
/examples/demo5/src/page5/main.mp.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './App.vue'
3 |
4 | export default function createApp() {
5 | const container = document.createElement('div')
6 | container.id = 'app'
7 | document.body.appendChild(container)
8 |
9 | return new Vue({
10 | el: '#app',
11 | render: h => h(App)
12 | })
13 | }
14 |
--------------------------------------------------------------------------------
/examples/demo6/build/miniprogram.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | origin: 'https://test.miniprogram.com',
3 | entry: '/test/aaa',
4 | router: {
5 | index: [
6 | '/test/aaa',
7 | '/test/bbb',
8 | ],
9 | },
10 | redirect: {
11 | notFound: 'index',
12 | accessDenied: 'index',
13 | },
14 | app: {
15 | navigationBarTitleText: 'miniprogram-project',
16 | },
17 | projectConfig: {
18 | appid: 'wx14c7c4cd189644a1',
19 | projectname: 'kbone-demo6',
20 | },
21 | packageConfig: {
22 | author: 'wechat-miniprogram',
23 | },
24 | }
--------------------------------------------------------------------------------
/examples/demo6/src/main.js:
--------------------------------------------------------------------------------
1 | import { render, h } from 'omio'
2 | import './components/todo'
3 | import Store from './store'
4 |
5 | render(, '#app', new Store)
6 |
--------------------------------------------------------------------------------
/examples/demo6/src/main.mp.js:
--------------------------------------------------------------------------------
1 | import { render, h } from 'omio'
2 | import './components/todo'
3 | import Store from './store'
4 |
5 | export default function createApp() {
6 | const container = document.createElement('div')
7 | container.id = 'app'
8 | document.body.appendChild(container)
9 | render(, '#app', new Store)
10 | }
11 |
--------------------------------------------------------------------------------
/examples/demo7/src/common/Footer.vue:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
10 |
11 |
18 |
--------------------------------------------------------------------------------
/examples/demo7/src/common/Header.vue:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
10 |
11 |
18 |
--------------------------------------------------------------------------------
/examples/demo7/src/page1/main.mp.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './App.vue'
3 |
4 | export default function createApp() {
5 | const container = document.createElement('div')
6 | container.id = 'app'
7 | document.body.appendChild(container)
8 |
9 | return new Vue({
10 | el: '#app',
11 | render: h => h(App)
12 | })
13 | }
14 |
--------------------------------------------------------------------------------
/examples/demo7/src/page2/main.mp.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './App.vue'
3 |
4 | export default function createApp() {
5 | const container = document.createElement('div')
6 | container.id = 'app'
7 | document.body.appendChild(container)
8 |
9 | return new Vue({
10 | el: '#app',
11 | render: h => h(App)
12 | })
13 | }
14 |
--------------------------------------------------------------------------------
/examples/demo7/src/page3/main.mp.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './App.vue'
3 |
4 | export default function createApp() {
5 | const container = document.createElement('div')
6 | container.id = 'app'
7 | document.body.appendChild(container)
8 |
9 | return new Vue({
10 | el: '#app',
11 | render: h => h(App)
12 | })
13 | }
14 |
--------------------------------------------------------------------------------
/examples/demo7/src/page4/main.mp.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './App.vue'
3 |
4 | export default function createApp() {
5 | const container = document.createElement('div')
6 | container.id = 'app'
7 | document.body.appendChild(container)
8 |
9 | return new Vue({
10 | el: '#app',
11 | render: h => h(App)
12 | })
13 | }
14 |
--------------------------------------------------------------------------------
/examples/demo8/build/miniprogram.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | origin: 'https://test.miniprogram.com',
3 | entry: '/test/aaa',
4 | router: {
5 | index: [
6 | '/test/aaa',
7 | '/test/bbb',
8 | ],
9 | },
10 | redirect: {
11 | notFound: 'index',
12 | accessDenied: 'index',
13 | },
14 | app: {
15 | navigationBarTitleText: 'miniprogram-project',
16 | },
17 | projectConfig: {
18 | appid: 'wx14c7c4cd189644a1',
19 | projectname: 'kbone-demo8',
20 | },
21 | packageConfig: {
22 | author: 'wechat-miniprogram',
23 | },
24 | }
--------------------------------------------------------------------------------
/examples/demo8/src/assets/index.css:
--------------------------------------------------------------------------------
1 |
2 | body {
3 | background: #efcc19;
4 | padding: 0;
5 | margin: 0;
6 | font: 20rpx/1 HanHei SC, PingHei, PingFang SC, STHeitiSC-Light, Helvetica Neue, Helvetica, Arial, sans-serif;
7 | overflow: hidden;
8 | cursor: default;
9 | text-rendering: optimizeLegibility;
10 | -webkit-font-smoothing: antialiased;
11 | -moz-osx-font-smoothing: grayscale;
12 | -moz-font-feature-settings: "liga", "kern";
13 | direction: ltr;
14 | text-align: left
15 | }
--------------------------------------------------------------------------------
/examples/demo8/src/components/game/index.js:
--------------------------------------------------------------------------------
1 | import { define, h, rpx } from 'omio'
2 | import './_index.css'
3 |
4 | define('my-game', _ => (
5 |
6 | {_.store.data.map.map(row => {
7 | return
8 | {row.map(col => {
9 | if (col) {
10 | return
11 | }
12 | return
13 | })}
14 |
15 | })}
16 |
17 | ), {
18 | use: ['map'],
19 | css: ("undefined" != typeof wx && wx.getSystemInfoSync) ? '' : rpx(require('./_index.css'))
20 | })
--------------------------------------------------------------------------------
/examples/demo8/src/main.mp.js:
--------------------------------------------------------------------------------
1 | import { render, h } from 'omio'
2 | import './components/index'
3 | import store from './stores/index'
4 | import './assets/index.css'
5 |
6 | export default function createApp() {
7 | const container = document.createElement('div')
8 | container.id = 'app'
9 | document.body.appendChild(container)
10 |
11 | render(, '#app', store)
12 | }
13 |
14 | //web
15 | "undefined" != typeof wx && wx.getSystemInfoSync || createApp()
16 |
--------------------------------------------------------------------------------
/examples/demo9/src/common/Footer.vue:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
10 |
11 |
18 |
--------------------------------------------------------------------------------
/examples/demo9/src/common/Header.vue:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
10 |
11 |
18 |
--------------------------------------------------------------------------------
/examples/demo9/src/img/page1-sel.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tencent/kbone/55fa1e27295b8b26e43c1487167ea07345eb88a2/examples/demo9/src/img/page1-sel.png
--------------------------------------------------------------------------------
/examples/demo9/src/img/page1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tencent/kbone/55fa1e27295b8b26e43c1487167ea07345eb88a2/examples/demo9/src/img/page1.png
--------------------------------------------------------------------------------
/examples/demo9/src/img/page2-sel.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tencent/kbone/55fa1e27295b8b26e43c1487167ea07345eb88a2/examples/demo9/src/img/page2-sel.png
--------------------------------------------------------------------------------
/examples/demo9/src/img/page2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tencent/kbone/55fa1e27295b8b26e43c1487167ea07345eb88a2/examples/demo9/src/img/page2.png
--------------------------------------------------------------------------------
/examples/demo9/src/page1/main.mp.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './App.vue'
3 |
4 | export default function createApp() {
5 | const container = document.createElement('div')
6 | container.id = 'app'
7 | document.body.appendChild(container)
8 |
9 | return new Vue({
10 | el: '#app',
11 | render: h => h(App)
12 | })
13 | }
14 |
--------------------------------------------------------------------------------
/examples/demo9/src/page2/main.mp.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './App.vue'
3 |
4 | export default function createApp() {
5 | const container = document.createElement('div')
6 | container.id = 'app'
7 | document.body.appendChild(container)
8 |
9 | return new Vue({
10 | el: '#app',
11 | render: h => h(App)
12 | })
13 | }
14 |
--------------------------------------------------------------------------------
/examples/demo9/src/page3/main.mp.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './App.vue'
3 |
4 | export default function createApp() {
5 | const container = document.createElement('div')
6 | container.id = 'app'
7 | document.body.appendChild(container)
8 |
9 | return new Vue({
10 | el: '#app',
11 | render: h => h(App)
12 | })
13 | }
14 |
--------------------------------------------------------------------------------
/examples/kbone-cloud/cloudfunctions/add/config.json:
--------------------------------------------------------------------------------
1 | {
2 | }
--------------------------------------------------------------------------------
/examples/kbone-cloud/cloudfunctions/add/index.js:
--------------------------------------------------------------------------------
1 | /**
2 | * 云函数 add
3 | */
4 | const cloud = require('wx-server-sdk')
5 |
6 | cloud.init({
7 | env: cloud.DYNAMIC_CURRENT_ENV
8 | })
9 |
10 | // 获取数据库引用
11 | const db = cloud.database()
12 |
13 | // 云函数入口函数
14 | exports.main = async (event, context) => {
15 | try {
16 | console.log(event.title, event.desc)
17 | return await db.collection('test').add({
18 | // data 字段表示需新增的 JSON 数据
19 | data: {
20 | title: event.title,
21 | desc: event.desc
22 | }
23 | })
24 | } catch(e) {
25 | console.error(e)
26 | }
27 | }
--------------------------------------------------------------------------------
/examples/kbone-cloud/cloudfunctions/add/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "callback",
3 | "version": "1.0.0",
4 | "description": "",
5 | "main": "index.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1"
8 | },
9 | "author": "",
10 | "license": "ISC",
11 | "dependencies": {
12 | "wx-server-sdk": "latest"
13 | }
14 | }
--------------------------------------------------------------------------------
/examples/kbone-cloud/cloudfunctions/get/config.json:
--------------------------------------------------------------------------------
1 | {
2 | "permissions": {
3 | "openapi": [
4 | "customerServiceMessage.send"
5 | ]
6 | }
7 | }
--------------------------------------------------------------------------------
/examples/kbone-cloud/cloudfunctions/get/index.js:
--------------------------------------------------------------------------------
1 | /**
2 | * 云函数 get
3 | */
4 | const cloud = require('wx-server-sdk')
5 |
6 | cloud.init({
7 | env: cloud.DYNAMIC_CURRENT_ENV
8 | })
9 |
10 | // 获取数据库引用
11 | const db = cloud.database()
12 |
13 | // 云函数入口函数
14 | exports.main = async (event, context) => {
15 | let res = []
16 | res = await db.collection('test').get()
17 | console.log(res)
18 | return res.data
19 | }
--------------------------------------------------------------------------------
/examples/kbone-cloud/cloudfunctions/get/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "callback",
3 | "version": "1.0.0",
4 | "description": "",
5 | "main": "index.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1"
8 | },
9 | "author": "",
10 | "license": "ISC",
11 | "dependencies": {
12 | "wx-server-sdk": "latest"
13 | }
14 | }
--------------------------------------------------------------------------------
/lerna.json:
--------------------------------------------------------------------------------
1 | {
2 | "lerna": "3.16.4",
3 | "version": "independent",
4 | "npmClient": "npm",
5 | "command": {
6 | "publish": {
7 | "ignoreChanges": ["packages/*/test/**/*", "*.md", ".npmignore"]
8 | }
9 | },
10 | "packages":[
11 | "packages/*"
12 | ]
13 | }
14 |
--------------------------------------------------------------------------------
/packages/file-wrapper-loader/.npmignore:
--------------------------------------------------------------------------------
1 | .idea
2 | .DS_Store
3 | package-lock.json
4 |
5 | logs
6 | *.log
7 | npm-debug.log*
8 | yarn-debug.log*
9 | yarn-error.log*
10 |
11 | test
12 | node_modules
13 | coverage
--------------------------------------------------------------------------------
/packages/file-wrapper-loader/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # 更新日志
2 |
--------------------------------------------------------------------------------
/packages/file-wrapper-loader/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "file-wrapper-loader",
3 | "version": "0.0.4",
4 | "description": "a loader for wrapper the import file",
5 | "main": "src/index.js",
6 | "miniprogram": "src",
7 | "scripts": {},
8 | "repository": {
9 | "type": "git",
10 | "url": "https://github.com/wechat-miniprogram/kbone.git"
11 | },
12 | "author": "wechat-miniprogram",
13 | "license": "MIT",
14 | "devDependencies": {
15 | "loader-utils": "^2.0.0"
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/packages/file-wrapper-loader/src/index.js:
--------------------------------------------------------------------------------
1 | const loaderUtils = require('loader-utils')
2 |
3 | module.exports = function(source) {
4 | const options = loaderUtils.getOptions(this)
5 |
6 | if (options) {
7 | if (typeof options.before === 'string') source = options.before + source
8 | if (typeof options.after === 'string') source = options.after + source
9 | }
10 |
11 | return source
12 | }
13 |
--------------------------------------------------------------------------------
/packages/html-to-js-loader/.npmignore:
--------------------------------------------------------------------------------
1 | .idea
2 | .DS_Store
3 | package-lock.json
4 |
5 | logs
6 | *.log
7 | npm-debug.log*
8 | yarn-debug.log*
9 | yarn-error.log*
10 |
11 | test
12 | node_modules
13 | coverage
--------------------------------------------------------------------------------
/packages/html-to-js-loader/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # 更新日志
2 |
--------------------------------------------------------------------------------
/packages/kbone-cli/.eslintrc:
--------------------------------------------------------------------------------
1 | {
2 | "parserOptions": {
3 | "ecmaVersion": 6,
4 | "sourceType": "module",
5 | "ecmaFeatures": {
6 | "jsx": true
7 | }
8 | },
9 | "rules": {}
10 | }
11 |
--------------------------------------------------------------------------------
/packages/kbone-cli/.npmignore:
--------------------------------------------------------------------------------
1 | .*.swp
2 | ._*
3 | .DS_Store
4 | .git
5 | .hg
6 | .npmrc
7 | .lock-wscript
8 | .svn
9 | .wafpickle-*
10 | config.gypi
11 | CVS
12 | npm-debug.log
--------------------------------------------------------------------------------
/packages/kbone-cli/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # 更新日志
2 |
3 | ## 0.3.9
4 |
5 | * 支持 kbone-ui 模板
--------------------------------------------------------------------------------
/packages/kbone-cli/src/logger.js:
--------------------------------------------------------------------------------
1 | const chalk = require('chalk')
2 |
3 | exports.info = function(type, message) {
4 | console.log(`${chalk.bold.magenta(type)}: ${message}`)
5 | }
6 |
7 | exports.error = function(message) {
8 | console.log(chalk.red(message))
9 | process.exit(1)
10 | }
11 |
12 | exports.success = function(message) {
13 | console.log(chalk.green(message))
14 | }
15 |
--------------------------------------------------------------------------------
/packages/kbone-cli/src/mirror.json:
--------------------------------------------------------------------------------
1 | {
2 | "npm": "https://registry.npmjs.org/",
3 | "cnpm": "http://r.cnpmjs.org/",
4 | "taobao": "https://registry.npm.taobao.org/",
5 | "nj": "https://registry.nodejitsu.com/",
6 | "rednpm": "http://registry.mirror.cqupt.edu.cn",
7 | "skimdb": "https://skimdb.npmjs.com/registry"
8 | }
9 |
--------------------------------------------------------------------------------
/packages/kbone-tool/.npmignore:
--------------------------------------------------------------------------------
1 | .idea
2 | .DS_Store
3 | package-lock.json
4 |
5 | logs
6 | *.log
7 | npm-debug.log*
8 | yarn-debug.log*
9 | yarn-error.log*
10 |
11 | test
12 | node_modules
13 | coverage
--------------------------------------------------------------------------------
/packages/kbone-tool/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # 更新日志
2 |
3 | ## 0.0.8
4 |
5 | * 支持 jquery.compat 方法
6 |
7 | ## 0.0.7
8 |
9 | * 废弃 vue.useGlobal 接口
10 |
11 | ## 0.0.6
12 |
13 | * 支持 weui 的 useForm 方法
14 |
--------------------------------------------------------------------------------
/packages/kbone-tool/src/index.js:
--------------------------------------------------------------------------------
1 | const vueTools = require('./vue')
2 | const weuiTools = require('./weui')
3 | const jqueryTools = require('./jquery')
4 |
5 | module.exports = {
6 | vue: vueTools,
7 | weui: weuiTools,
8 | jquery: jqueryTools,
9 | }
10 |
--------------------------------------------------------------------------------
/packages/kbone-tool/src/tool.js:
--------------------------------------------------------------------------------
1 | /**
2 | * 节流,一个同步流中只调用一次该函数
3 | */
4 | const waitFuncSet = new Set()
5 | function throttle(func) {
6 | return () => {
7 | if (waitFuncSet.has(func)) return
8 |
9 | waitFuncSet.add(func)
10 |
11 | Promise.resolve().then(() => {
12 | if (waitFuncSet.has(func)) {
13 | waitFuncSet.delete(func)
14 | func()
15 | }
16 | }).catch(console.error)
17 | }
18 | }
19 |
20 | module.exports = {
21 | throttle,
22 | }
23 |
--------------------------------------------------------------------------------
/packages/kbone-tool/src/vue.js:
--------------------------------------------------------------------------------
1 | /**
2 | * 废弃
3 | */
4 | function useGlobal() {
5 | // 此接口的实现存在内存泄露,建议走如下逻辑:
6 | // 1、页面退出/隐藏时清算 global,确保 global 没有当前页面的引用(必要时可使用深拷贝)
7 | // 2、页面进入时使用纯净的 global
8 | }
9 |
10 | module.exports = {
11 | useGlobal,
12 | }
13 |
--------------------------------------------------------------------------------
/packages/kbone-tool/test/vue.test.js:
--------------------------------------------------------------------------------
1 | test('useGlobal', () => {
2 | // ignore
3 | })
4 |
--------------------------------------------------------------------------------
/packages/kbone-ui/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "plugins": [
3 | "@babel/plugin-proposal-object-rest-spread"
4 | ]
5 | }
6 |
--------------------------------------------------------------------------------
/packages/kbone-ui/.npmignore:
--------------------------------------------------------------------------------
1 | .idea
2 | .DS_Store
3 | package-lock.json
4 |
5 | logs
6 | *.log
7 | npm-debug.log*
8 | yarn-debug.log*
9 | yarn-error.log*
10 |
11 | test
12 | node_modules
13 | coverage
--------------------------------------------------------------------------------
/packages/kbone-ui/.stylelintrc.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | 'extends': 'stylelint-config-standard',
3 | 'rules': {
4 | 'selector-type-no-unknown': null,
5 | 'at-rule-no-unknown': null,
6 | 'at-rule-name-case': null,
7 | 'no-descending-specificity': null,
8 | 'no-empty-source': null,
9 | },
10 | }
--------------------------------------------------------------------------------
/packages/kbone-ui/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # 更新日志
2 |
3 | ## 1.0.10
4 |
5 | * 补充 TouchEvent/Touch 兼容(safari 浏览器)
6 |
7 | ## 1.0.9
8 |
9 | * 延迟 wx-icon 字体加载
10 |
--------------------------------------------------------------------------------
/packages/kbone-ui/index.js:
--------------------------------------------------------------------------------
1 | if (process.env.NODE_ENV === 'production') {
2 | module.exports = require('./dist/index.js')
3 | } else {
4 | module.exports = require('./dist/index.dev.js')
5 | }
6 |
--------------------------------------------------------------------------------
/packages/kbone-ui/src/components/wx-animation/index.html:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/packages/kbone-ui/src/components/wx-animation/index.js:
--------------------------------------------------------------------------------
1 | import Base from '../base'
2 | import tpl from './index.html'
3 | import style from './index.less'
4 |
5 | const template = document.createElement('template')
6 | template.innerHTML = `${tpl}`
7 |
8 | export default class WxAnimation extends Base {
9 | constructor() {
10 | super()
11 |
12 | this.initShadowRoot(template, WxAnimation.observedAttributes)
13 | }
14 |
15 | static register() {
16 | customElements.define('wx-animation', WxAnimation)
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/packages/kbone-ui/src/components/wx-animation/index.less:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tencent/kbone/55fa1e27295b8b26e43c1487167ea07345eb88a2/packages/kbone-ui/src/components/wx-animation/index.less
--------------------------------------------------------------------------------
/packages/kbone-ui/src/components/wx-button/index.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/packages/kbone-ui/src/components/wx-canvas/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/packages/kbone-ui/src/components/wx-canvas/index.less:
--------------------------------------------------------------------------------
1 | :host {
2 | width: 300px;
3 | height: 150px;
4 | display: block;
5 | position: relative;
6 |
7 | &([hidden]) {
8 | display: none;
9 | }
10 |
11 | & canvas {
12 | position: absolute;
13 | top: 0;
14 | left: 0;
15 | }
16 |
17 | .wx-canvas-slot {
18 | position: absolute;
19 | top: 0;
20 | left: 0;
21 | width: 100%;
22 | height: 100%;
23 | overflow: hidden;
24 | pointer-events: none;
25 |
26 | * {
27 | pointer-events: auto;
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/packages/kbone-ui/src/components/wx-capture/index.html:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/packages/kbone-ui/src/components/wx-capture/index.less:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tencent/kbone/55fa1e27295b8b26e43c1487167ea07345eb88a2/packages/kbone-ui/src/components/wx-capture/index.less
--------------------------------------------------------------------------------
/packages/kbone-ui/src/components/wx-catch/index.html:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/packages/kbone-ui/src/components/wx-catch/index.less:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tencent/kbone/55fa1e27295b8b26e43c1487167ea07345eb88a2/packages/kbone-ui/src/components/wx-catch/index.less
--------------------------------------------------------------------------------
/packages/kbone-ui/src/components/wx-checkbox-group/index.html:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/packages/kbone-ui/src/components/wx-checkbox-group/index.less:
--------------------------------------------------------------------------------
1 | :host {
2 | display: block;
3 |
4 | &([hidden]) {
5 | display: none;
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/packages/kbone-ui/src/components/wx-checkbox/index.html:
--------------------------------------------------------------------------------
1 |
5 |
--------------------------------------------------------------------------------
/packages/kbone-ui/src/components/wx-form/index.html:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/packages/kbone-ui/src/components/wx-form/index.less:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tencent/kbone/55fa1e27295b8b26e43c1487167ea07345eb88a2/packages/kbone-ui/src/components/wx-form/index.less
--------------------------------------------------------------------------------
/packages/kbone-ui/src/components/wx-icon/index.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/packages/kbone-ui/src/components/wx-image/index.html:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/packages/kbone-ui/src/components/wx-image/index.less:
--------------------------------------------------------------------------------
1 | :host {
2 | width: 320px;
3 | height: 240px;
4 | display: inline-block;
5 | overflow: hidden;
6 |
7 | &([hidden]) {
8 | display: none;
9 | }
10 | }
11 |
12 | #div {
13 | width: 100%;
14 | height: 100%;
15 | }
16 |
--------------------------------------------------------------------------------
/packages/kbone-ui/src/components/wx-input/index.html:
--------------------------------------------------------------------------------
1 |
5 |
--------------------------------------------------------------------------------
/packages/kbone-ui/src/components/wx-label/index.html:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/packages/kbone-ui/src/components/wx-label/index.less:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tencent/kbone/55fa1e27295b8b26e43c1487167ea07345eb88a2/packages/kbone-ui/src/components/wx-label/index.less
--------------------------------------------------------------------------------
/packages/kbone-ui/src/components/wx-match-media/index.html:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/packages/kbone-ui/src/components/wx-match-media/index.less:
--------------------------------------------------------------------------------
1 | :host {
2 | display: block;
3 |
4 | &([hidden]) {
5 | display: none;
6 | }
7 | }
8 |
9 | .wx-match-media-hidden {
10 | display: none;
11 | }
12 |
--------------------------------------------------------------------------------
/packages/kbone-ui/src/components/wx-movable-area/index.html:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/packages/kbone-ui/src/components/wx-movable-area/index.less:
--------------------------------------------------------------------------------
1 | :host {
2 | display: block;
3 | position: relative;
4 | width: 10px;
5 | height: 10px;
6 |
7 | &([hidden]) {
8 | display: none;
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/packages/kbone-ui/src/components/wx-movable-view/index.html:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/packages/kbone-ui/src/components/wx-movable-view/index.less:
--------------------------------------------------------------------------------
1 | :host {
2 | display: inline-block;
3 | width: 10px;
4 | height: 10px;
5 | top: 0;
6 | left: 0;
7 | position: absolute;
8 |
9 | &([hidden]) {
10 | display: none;
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/packages/kbone-ui/src/components/wx-picker-view-column/index.html:
--------------------------------------------------------------------------------
1 |
6 |
--------------------------------------------------------------------------------
/packages/kbone-ui/src/components/wx-picker-view/index.html:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/packages/kbone-ui/src/components/wx-picker-view/index.less:
--------------------------------------------------------------------------------
1 | :host {
2 | display: block;
3 | user-select: none;
4 |
5 | &([hidden]) {
6 | display: none;
7 | }
8 |
9 | img {
10 | -webkit-user-drag: none;
11 | }
12 | }
13 |
14 | .wrapper {
15 | display: -webkit-box;
16 | display: -webkit-flex;
17 | display: flex;
18 | position: relative;
19 | overflow: hidden;
20 | }
21 |
--------------------------------------------------------------------------------
/packages/kbone-ui/src/components/wx-picker/dialog.html:
--------------------------------------------------------------------------------
1 |
2 |
12 |
--------------------------------------------------------------------------------
/packages/kbone-ui/src/components/wx-picker/index.html:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/packages/kbone-ui/src/components/wx-picker/index.less:
--------------------------------------------------------------------------------
1 | :host {
2 | display: block;
3 | cursor: pointer;
4 | }
5 |
--------------------------------------------------------------------------------
/packages/kbone-ui/src/components/wx-progress/index.html:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/packages/kbone-ui/src/components/wx-progress/index.less:
--------------------------------------------------------------------------------
1 | :host {
2 | display: flex;
3 | align-items: center;
4 |
5 | &([hidden]) {
6 | display: none;
7 | }
8 | }
9 |
10 | .wx-progress-bar {
11 | flex: 1;
12 | overflow: hidden;
13 | }
14 |
15 | .wx-progress-inner-bar {
16 | width: 0;
17 | height: 100%;
18 | }
19 |
20 | .wx-progress-info {
21 | margin-top: 0;
22 | margin-bottom: 0;
23 | min-width: 2em;
24 | margin-left: 15px;
25 | font-size: 16px;
26 | }
27 |
--------------------------------------------------------------------------------
/packages/kbone-ui/src/components/wx-radio-group/index.html:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/packages/kbone-ui/src/components/wx-radio-group/index.less:
--------------------------------------------------------------------------------
1 | :host {
2 | display: block;
3 |
4 | &([hidden]) {
5 | display: none;
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/packages/kbone-ui/src/components/wx-radio/index.html:
--------------------------------------------------------------------------------
1 |
5 |
--------------------------------------------------------------------------------
/packages/kbone-ui/src/components/wx-rich-text/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/packages/kbone-ui/src/components/wx-rich-text/index.less:
--------------------------------------------------------------------------------
1 | :host([hidden]) {
2 | display: none;
3 | }
4 |
--------------------------------------------------------------------------------
/packages/kbone-ui/src/components/wx-scroll-view/index.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/packages/kbone-ui/src/components/wx-slider/index.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/packages/kbone-ui/src/components/wx-swiper-item/index.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/packages/kbone-ui/src/components/wx-swiper-item/index.less:
--------------------------------------------------------------------------------
1 | :host {
2 | display: block;
3 | overflow: hidden;
4 | will-change: transform;
5 |
6 | &([hidden]) {
7 | display: none;
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/packages/kbone-ui/src/components/wx-swiper/index.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/packages/kbone-ui/src/components/wx-switch/index.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/packages/kbone-ui/src/components/wx-text/index.html:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/packages/kbone-ui/src/components/wx-text/index.less:
--------------------------------------------------------------------------------
1 | :host {
2 | cursor: text;
3 |
4 | &([user-select]) {
5 | cursor: auto;
6 | user-select: text;
7 | -webkit-user-select: text;
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/packages/kbone-ui/src/components/wx-textarea/index.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/packages/kbone-ui/src/components/wx-view/index.html:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/packages/kbone-ui/src/components/wx-view/index.less:
--------------------------------------------------------------------------------
1 | :host {
2 | display: block;
3 |
4 | &([hidden]) {
5 | display: none;
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/packages/kbone-ui/src/styles/mixin.less:
--------------------------------------------------------------------------------
1 | @import "./mixin/mobile.less";
2 | @import "./mixin/setArrow.less";
3 | @import "./mixin/setOnepx.less";
4 | @import "./mixin/text.less";
5 |
--------------------------------------------------------------------------------
/packages/kbone-ui/src/styles/variable.less:
--------------------------------------------------------------------------------
1 | @import "./variable/global.less";
2 | @import "./variable/color.less";
3 | @import "./variable/button.less";
4 | @import "./variable/dialog.less";
5 | @import "./variable/grid.less";
6 | @import "./variable/msg.less";
7 | @import "./variable/progress.less";
8 | @import "./variable/cell.less";
9 | @import "./variable/hover.less";
10 |
11 | @borderColor: #d9d9d9;
12 |
--------------------------------------------------------------------------------
/packages/kbone-ui/src/styles/variable/dialog.less:
--------------------------------------------------------------------------------
1 | @weuiDialogBackgroundColor: #FFFFFF;
2 | @weuiDialogLineColor: #D5D5D6;
3 | @weuiDialogLinkColor: #3CC51F;
4 | @weuiDialogLinkActiveBc: #EEEEEE;
5 | @weuiDialogGapWidth: 1.6em;
6 |
--------------------------------------------------------------------------------
/packages/kbone-ui/src/styles/variable/global.less:
--------------------------------------------------------------------------------
1 | // font
2 | @weuiFontEN:-apple-system-font, "Helvetica Neue";
3 | @weuiFontCN:"PingFang SC","Hiragino Sans GB","Microsoft YaHei";
4 | @weuiFontSans:sans-serif;
5 | @weuiFontDefault:@weuiFontEN,@weuiFontSans;
6 |
--------------------------------------------------------------------------------
/packages/kbone-ui/src/styles/variable/grid.less:
--------------------------------------------------------------------------------
1 | @weuiGridBorderColor:#D9D9D9;
2 | @weuiGridFontSize: 14px;
3 | @weuiGridIconSize: 28px;
4 | @weuiGridColumnCount: 3;
5 |
--------------------------------------------------------------------------------
/packages/kbone-ui/src/styles/variable/hover.less:
--------------------------------------------------------------------------------
1 | @weuiDefaultHoverBg:rgba(0,0,0,0.1);
2 | @weuiDefaultHoverBgDark:rgba(255, 255, 255 ,0.1);
3 | @weuiDefaultHoverOpacity:.7;
4 |
--------------------------------------------------------------------------------
/packages/kbone-ui/src/styles/variable/msg.less:
--------------------------------------------------------------------------------
1 | @weuiMsgPaddingTop:36px;
2 | @weuiMsgIconGap:30px;
3 | @weuiMsgTitleGap:5px;
4 | @weuiMsgTextGap:25px;
5 | @weuiMsgOprGap:25px;
6 | @weuiMsgExtraAreaGap:15px;
7 | @weuiMsgExtraAreaOfMinHeight:438px;
8 |
--------------------------------------------------------------------------------
/packages/kbone-ui/src/styles/variable/progress.less:
--------------------------------------------------------------------------------
1 | @weuiProgressBg: #EBEBEB;
2 | @weuiProgressColor: #09BB07;
3 | @weuiProgressHeight: 3px;
4 | @weuiProgressCloseBg: #EF4F4F;
5 | @weuiProgressActiveBg: #C13E3E;
6 |
--------------------------------------------------------------------------------
/packages/kbone-ui/src/weui-components/mp-actionsheet/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/packages/kbone-ui/src/weui-components/mp-actionsheet/index.less:
--------------------------------------------------------------------------------
1 | .weui-mask.weui-mask_hidden {
2 | opacity: 0;
3 | transform: scale3d(1, 1, 0);
4 | }
5 |
6 | .weui-mask {
7 | opacity: 1;
8 | transform: scale3d(1, 1, 1);
9 | transition: all 0.3s;
10 | }
11 |
--------------------------------------------------------------------------------
/packages/kbone-ui/src/weui-components/mp-badge/index.html:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/packages/kbone-ui/src/weui-components/mp-badge/index.less:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tencent/kbone/55fa1e27295b8b26e43c1487167ea07345eb88a2/packages/kbone-ui/src/weui-components/mp-badge/index.less
--------------------------------------------------------------------------------
/packages/kbone-ui/src/weui-components/mp-cell/index.less:
--------------------------------------------------------------------------------
1 | .weui-cell_wxss.weui-cell_wxss::before {
2 | display: block;
3 | }
4 |
5 | #error {
6 | display: block;
7 | }
8 |
--------------------------------------------------------------------------------
/packages/kbone-ui/src/weui-components/mp-cells/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/packages/kbone-ui/src/weui-components/mp-cells/index.less:
--------------------------------------------------------------------------------
1 | .weui-cells__group_wxss.weui-cells__group_wxss .weui-cells__title {
2 | margin-top: 24px;
3 | }
4 |
5 | .weui-cells__group_form .weui-cells__tips {
6 | margin-top: 8px;
7 | padding: 0 32px;
8 | color: var(--weui-FG-1);
9 | }
10 |
--------------------------------------------------------------------------------
/packages/kbone-ui/src/weui-components/mp-checkbox-group/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/packages/kbone-ui/src/weui-components/mp-checkbox-group/index.less:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tencent/kbone/55fa1e27295b8b26e43c1487167ea07345eb88a2/packages/kbone-ui/src/weui-components/mp-checkbox-group/index.less
--------------------------------------------------------------------------------
/packages/kbone-ui/src/weui-components/mp-checkbox/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/packages/kbone-ui/src/weui-components/mp-dialog/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
13 |
14 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/packages/kbone-ui/src/weui-components/mp-dialog/index.less:
--------------------------------------------------------------------------------
1 | .weui-dialog.weui-dialog_hidden {
2 | opacity: 0;
3 | transform: scale3d(1, 1, 0);
4 | }
5 |
6 | .weui-dialog {
7 | opacity: 1;
8 | -webkit-transform: scale3d(1, 1, 1) translateY(-50%);
9 | transform: scale3d(1, 1, 1) translateY(-50%);
10 | transition: all 0.2s ease-in;
11 | }
12 |
13 | .weui-mask.weui-mask_hidden {
14 | opacity: 0;
15 | transform: scale3d(1, 1, 0);
16 | }
17 |
18 | .weui-mask {
19 | opacity: 1;
20 | transform: scale3d(1, 1, 1);
21 | transition: all 0.2s ease-in;
22 | }
23 |
--------------------------------------------------------------------------------
/packages/kbone-ui/src/weui-components/mp-form-page/index.less:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tencent/kbone/55fa1e27295b8b26e43c1487167ea07345eb88a2/packages/kbone-ui/src/weui-components/mp-form-page/index.less
--------------------------------------------------------------------------------
/packages/kbone-ui/src/weui-components/mp-form/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/packages/kbone-ui/src/weui-components/mp-form/index.less:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tencent/kbone/55fa1e27295b8b26e43c1487167ea07345eb88a2/packages/kbone-ui/src/weui-components/mp-form/index.less
--------------------------------------------------------------------------------
/packages/kbone-ui/src/weui-components/mp-gallery/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | 删除
6 |
7 |
8 |
--------------------------------------------------------------------------------
/packages/kbone-ui/src/weui-components/mp-gallery/index.less:
--------------------------------------------------------------------------------
1 | .weui-gallery {
2 | display: none;
3 | }
4 |
5 | .weui-gallery_show.weui-gallery {
6 | display: flex;
7 | }
8 |
--------------------------------------------------------------------------------
/packages/kbone-ui/src/weui-components/mp-grids/index.html:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/packages/kbone-ui/src/weui-components/mp-grids/index.less:
--------------------------------------------------------------------------------
1 | .weui-grid .weui-grid__icon_img {
2 | width: 100%;
3 | height: 100%;
4 | }
5 |
--------------------------------------------------------------------------------
/packages/kbone-ui/src/weui-components/mp-half-screen-dialog/index.less:
--------------------------------------------------------------------------------
1 | .weui-mask,
2 | .weui-half-screen-dialog {
3 | transition: all 0.3s;
4 | }
5 |
6 | .weui-hidden {
7 | .weui-mask {
8 | visibility: hidden;
9 | opacity: 0;
10 | }
11 |
12 | .weui-half-screen-dialog {
13 | transform: translateY(100%);
14 | }
15 | }
16 |
17 | .weui-show {
18 | .weui-mask {
19 | opacity: 1;
20 | visibility: visible;
21 | }
22 |
23 | .weui-half-screen-dialog {
24 | transform: translateY(0%);
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/packages/kbone-ui/src/weui-components/mp-icon/index.html:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/packages/kbone-ui/src/weui-components/mp-icon/index.less:
--------------------------------------------------------------------------------
1 | .weui-icon {
2 | vertical-align: middle;
3 | display: inline-block;
4 | background: black;
5 | mask-repeat: no-repeat;
6 | -webkit-mask-repeat: no-repeat;
7 | -moz-mask-repeat: no-repeat;
8 | mask-size: cover;
9 | -webkit-mask-size: cover;
10 | -moz-mask-size: cover;
11 | }
12 |
--------------------------------------------------------------------------------
/packages/kbone-ui/src/weui-components/mp-loading/index.html:
--------------------------------------------------------------------------------
1 |
9 |
--------------------------------------------------------------------------------
/packages/kbone-ui/src/weui-components/mp-loading/index.less:
--------------------------------------------------------------------------------
1 | .wx_loading_view {
2 | display: flex;
3 | justify-content: center;
4 | align-items: center;
5 | overflow: hidden;
6 |
7 | &__hide {
8 | height: 0 !important;
9 | display: none;
10 | }
11 |
12 | &__animated&__hide {
13 | display: flex;
14 | }
15 | }
16 |
17 | .loading {
18 | color: rgba(255, 255, 255, 0.9);
19 | font-size: 17px;
20 | text-align: center;
21 | }
22 |
23 | .loading_view_translation {
24 | transition: height 0.2s 0.3s ease;
25 | }
26 |
--------------------------------------------------------------------------------
/packages/kbone-ui/src/weui-components/mp-msg/index.less:
--------------------------------------------------------------------------------
1 | .weui-msg__icon-img {
2 | width: 190px;
3 | height: 190px;
4 | }
5 |
--------------------------------------------------------------------------------
/packages/kbone-ui/src/weui-components/mp-navigation-bar/index.less:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tencent/kbone/55fa1e27295b8b26e43c1487167ea07345eb88a2/packages/kbone-ui/src/weui-components/mp-navigation-bar/index.less
--------------------------------------------------------------------------------
/packages/kbone-ui/src/weui-components/mp-searchbar/index.less:
--------------------------------------------------------------------------------
1 | .weui-search-bar__label wx-text {
2 | display: inline-block;
3 | font-size: 14px;
4 | vertical-align: middle;
5 | }
6 |
--------------------------------------------------------------------------------
/packages/kbone-ui/src/weui-components/mp-slideview/index.html:
--------------------------------------------------------------------------------
1 |
9 |
--------------------------------------------------------------------------------
/packages/kbone-ui/src/weui-components/mp-slideview/index.less:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tencent/kbone/55fa1e27295b8b26e43c1487167ea07345eb88a2/packages/kbone-ui/src/weui-components/mp-slideview/index.less
--------------------------------------------------------------------------------
/packages/kbone-ui/src/weui-components/mp-tabbar/index.html:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/packages/kbone-ui/src/weui-components/mp-tabbar/index.less:
--------------------------------------------------------------------------------
1 | @import "../../styles/variable";
2 | @import "../../styles/mixin";
3 |
4 | @media only screen and (min-width: 450px) {
5 | .weui-tabbar {
6 | flex-direction: column;
7 | width: 60px;
8 | height: 100%;
9 |
10 | &::before {
11 | left: unset;
12 | height: unset;
13 |
14 | .setRightLine(@weuiLineColorLight);
15 | }
16 | }
17 |
18 | .weui-tabbar__item {
19 | flex: none;
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/packages/kbone-ui/src/weui-components/mp-toptips/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/packages/kbone-ui/src/weui-components/mp-toptips/index.less:
--------------------------------------------------------------------------------
1 | .weui-toptips_show.weui-toptips {
2 | display: block;
3 | }
4 |
5 | .weui-toptips_show {
6 | -webkit-transform: translateZ(0) translateY(0);
7 | transform: translateZ(0) translateY(0);
8 | opacity: 1;
9 | }
10 |
11 | .weui-toptips_success {
12 | background-color: var(--weui-BRAND);
13 | }
14 |
15 | .weui-toptips_error {
16 | background-color: var(--weui-RED);
17 | }
18 |
19 | .weui-toptips_info {
20 | background-color: var(--weui-BLUE);
21 | }
22 |
--------------------------------------------------------------------------------
/packages/kbone-ui/src/weui-components/mp-uploader/index.less:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tencent/kbone/55fa1e27295b8b26e43c1487167ea07345eb88a2/packages/kbone-ui/src/weui-components/mp-uploader/index.less
--------------------------------------------------------------------------------
/packages/kbone-ui/src/weui-components/weui-base.js:
--------------------------------------------------------------------------------
1 | import Base from '../components/base'
2 |
3 | export default class WeuiBase extends Base {
4 | static get observedAttributes() {
5 | return ['ext-class', ...Base.observedAttributes]
6 | }
7 |
8 | /**
9 | * 属性
10 | */
11 | get extClass() {
12 | return this.getAttribute('ext-class') || ''
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/packages/kbone-ui/wx-components.js:
--------------------------------------------------------------------------------
1 | if (process.env.NODE_ENV === 'production') {
2 | module.exports = require('./dist/wx-components.js')
3 | } else {
4 | module.exports = require('./dist/wx-components.dev.js')
5 | }
6 |
--------------------------------------------------------------------------------
/packages/miniprogram-element/.npmignore:
--------------------------------------------------------------------------------
1 | .idea
2 | .DS_Store
3 | package-lock.json
4 |
5 | logs
6 | *.log
7 | npm-debug.log*
8 | yarn-debug.log*
9 | yarn-error.log*
10 |
11 | test
12 | node_modules
13 | coverage
--------------------------------------------------------------------------------
/packages/miniprogram-element/README.md:
--------------------------------------------------------------------------------
1 | # miniprogram-element
2 |
3 | ## 介绍
4 |
5 | 这是一个提供小程序渲染能力给 `miniprogram-render` 使用的自定义组件。
6 |
7 | > PS:此自定义组件无法脱离 `miniprogram-render` 使用。
8 |
9 | ## 安装
10 |
11 | ```
12 | npm install --save miniprogram-element
13 | ```
14 |
15 | ## 使用
16 |
17 | ```json
18 | {
19 | "usingComponents": {
20 | "element": "miniprogram-element"
21 | },
22 | }
23 | ```
24 |
25 | ```html
26 |
27 | ```
28 |
29 | pageId 和 nodeId 两个参数缺一不可,组件内部会根据传入的 pageId 找到对应的 window/document,然后根据 nodeId 找到对应的 dom 节点进行渲染。
30 |
--------------------------------------------------------------------------------
/packages/miniprogram-element/dist/custom-component/index.js:
--------------------------------------------------------------------------------
1 | Component({});
--------------------------------------------------------------------------------
/packages/miniprogram-element/dist/custom-component/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true
3 | }
--------------------------------------------------------------------------------
/packages/miniprogram-element/dist/custom-component/index.wxml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/packages/miniprogram-element/dist/custom-component/index.wxss:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tencent/kbone/55fa1e27295b8b26e43c1487167ea07345eb88a2/packages/miniprogram-element/dist/custom-component/index.wxss
--------------------------------------------------------------------------------
/packages/miniprogram-element/dist/index-vhost.js:
--------------------------------------------------------------------------------
1 | const base=require("./base");Component({behaviors:[base],options:{addGlobalClass:!0,virtualHost:!0}});
--------------------------------------------------------------------------------
/packages/miniprogram-element/dist/index-vhost.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {
4 | "element": "./index",
5 | "element-vhost": "./index-vhost"
6 | },
7 | "componentGenerics": {
8 | "custom-component": {
9 | "default": "./custom-component/index"
10 | }
11 | }
12 | }
--------------------------------------------------------------------------------
/packages/miniprogram-element/dist/index-vhost.wxml:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/packages/miniprogram-element/dist/index-vhost.wxss:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tencent/kbone/55fa1e27295b8b26e43c1487167ea07345eb88a2/packages/miniprogram-element/dist/index-vhost.wxss
--------------------------------------------------------------------------------
/packages/miniprogram-element/dist/index.js:
--------------------------------------------------------------------------------
1 | const base=require("./base");Component({behaviors:[base],options:{addGlobalClass:!0}});
--------------------------------------------------------------------------------
/packages/miniprogram-element/dist/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {
4 | "element": "./index",
5 | "element-vhost": "./index-vhost"
6 | },
7 | "componentGenerics": {
8 | "custom-component": {
9 | "default": "./custom-component/index"
10 | }
11 | }
12 | }
--------------------------------------------------------------------------------
/packages/miniprogram-element/dist/index.wxml:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/packages/miniprogram-element/dist/index.wxss:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tencent/kbone/55fa1e27295b8b26e43c1487167ea07345eb88a2/packages/miniprogram-element/dist/index.wxss
--------------------------------------------------------------------------------
/packages/miniprogram-element/src/custom-component/index.js:
--------------------------------------------------------------------------------
1 | Component({})
2 |
--------------------------------------------------------------------------------
/packages/miniprogram-element/src/custom-component/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true
3 | }
--------------------------------------------------------------------------------
/packages/miniprogram-element/src/custom-component/index.wxml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/packages/miniprogram-element/src/custom-component/index.wxss:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tencent/kbone/55fa1e27295b8b26e43c1487167ea07345eb88a2/packages/miniprogram-element/src/custom-component/index.wxss
--------------------------------------------------------------------------------
/packages/miniprogram-element/src/extra-props.js:
--------------------------------------------------------------------------------
1 | module.exports = [
2 | // { propName: 'aria-role', dataName: 'ariaRole' }
3 | ]
4 |
--------------------------------------------------------------------------------
/packages/miniprogram-element/src/index-vhost.js:
--------------------------------------------------------------------------------
1 | const base = require('./base')
2 |
3 | Component({
4 | behaviors: [base],
5 | options: {
6 | addGlobalClass: true, // 开启全局样式
7 | virtualHost: true, // 开启虚拟化 host
8 | },
9 | })
10 |
--------------------------------------------------------------------------------
/packages/miniprogram-element/src/index-vhost.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {
4 | "element": "./index",
5 | "element-vhost": "./index-vhost"
6 | },
7 | "componentGenerics": {
8 | "custom-component": {
9 | "default": "./custom-component/index"
10 | }
11 | }
12 | }
--------------------------------------------------------------------------------
/packages/miniprogram-element/src/index-vhost.wxml:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/packages/miniprogram-element/src/index-vhost.wxss:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tencent/kbone/55fa1e27295b8b26e43c1487167ea07345eb88a2/packages/miniprogram-element/src/index-vhost.wxss
--------------------------------------------------------------------------------
/packages/miniprogram-element/src/index.js:
--------------------------------------------------------------------------------
1 | const base = require('./base')
2 |
3 | Component({
4 | behaviors: [base],
5 | options: {
6 | addGlobalClass: true, // 开启全局样式
7 | },
8 | })
9 |
--------------------------------------------------------------------------------
/packages/miniprogram-element/src/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {
4 | "element": "./index",
5 | "element-vhost": "./index-vhost"
6 | },
7 | "componentGenerics": {
8 | "custom-component": {
9 | "default": "./custom-component/index"
10 | }
11 | }
12 | }
--------------------------------------------------------------------------------
/packages/miniprogram-element/src/index.wxml:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/packages/miniprogram-element/src/index.wxss:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tencent/kbone/55fa1e27295b8b26e43c1487167ea07345eb88a2/packages/miniprogram-element/src/index.wxss
--------------------------------------------------------------------------------
/packages/miniprogram-render/.npmignore:
--------------------------------------------------------------------------------
1 | .idea
2 | .DS_Store
3 | package-lock.json
4 |
5 | logs
6 | *.log
7 | npm-debug.log*
8 | yarn-debug.log*
9 | yarn-error.log*
10 |
11 | test
12 | node_modules
13 | coverage
--------------------------------------------------------------------------------
/packages/miniprogram-render/src/event/custom-event.js:
--------------------------------------------------------------------------------
1 | const Event = require('./event')
2 |
3 | class CustomEvent extends Event {
4 | constructor(name = '', options = {}) {
5 | super({
6 | name,
7 | ...options,
8 | })
9 | }
10 | }
11 |
12 | module.exports = CustomEvent
13 |
--------------------------------------------------------------------------------
/packages/miniprogram-render/src/util/pool.js:
--------------------------------------------------------------------------------
1 | class Pool {
2 | constructor(size) {
3 | this.$_size = size || 3000
4 | this.$_cache = []
5 | }
6 |
7 | /**
8 | * 添加一个对象
9 | */
10 | add(object) {
11 | if (this.$_cache.length >= this.$_size) return
12 |
13 | this.$_cache.push(object)
14 | }
15 |
16 | /**
17 | * 取出一个对象
18 | */
19 | get() {
20 | return this.$_cache.pop()
21 | }
22 | }
23 |
24 | module.exports = Pool
25 |
--------------------------------------------------------------------------------
/packages/miniprogram-render/test/bom/performance.test.js:
--------------------------------------------------------------------------------
1 | const mock = require('../mock')
2 |
3 | let window
4 |
5 | beforeAll(() => {
6 | const res = mock.createPage('home')
7 | window = res.window
8 | })
9 |
10 | test('performance: timeOrigin', () => {
11 | expect(+new Date() - window.performance.timeOrigin < 3600).toBe(true)
12 | })
13 |
14 | test('performance: now', () => {
15 | expect(+new Date() - window.performance.timeOrigin - window.performance.now() < 100).toBe(true)
16 | })
17 |
--------------------------------------------------------------------------------
/packages/miniprogram-render/test/bom/screen.test.js:
--------------------------------------------------------------------------------
1 | const mock = require('../mock')
2 |
3 | let window
4 |
5 | beforeAll(() => {
6 | const res = mock.createPage('home')
7 | window = res.window
8 | })
9 |
10 | test('screen: width/height', () => {
11 | expect(window.screen.width).toBe(200)
12 | expect(window.screen.height).toBe(300)
13 | })
14 |
--------------------------------------------------------------------------------
/packages/miniprogram-render/tool/index.js:
--------------------------------------------------------------------------------
1 | const webpack = require('webpack')
2 | const webpackConfig = require('./webpack.config')
3 |
4 | webpack(webpackConfig).run((err, stats) => {
5 | if (err) {
6 | console.log(err)
7 | } else {
8 | console.log(stats.toString({
9 | assets: true,
10 | cached: false,
11 | colors: true,
12 | children: false,
13 | errors: true,
14 | warnings: true,
15 | version: true,
16 | modules: false,
17 | publicPath: true,
18 | }))
19 | }
20 | })
21 |
--------------------------------------------------------------------------------
/packages/mp-webpack-plugin/.eslintrc.js:
--------------------------------------------------------------------------------
1 | const path = require('path')
2 |
3 | module.exports = {
4 | 'extends': [
5 | path.resolve(__dirname, '../../.eslintrc.js'),
6 | ],
7 | 'rules': {
8 | 'import/no-unresolved': 'off',
9 | 'import/no-absolute-path': 'off',
10 | },
11 | 'globals': {
12 | 'init': true,
13 | 'appConfig': true,
14 | },
15 | }
16 |
--------------------------------------------------------------------------------
/packages/mp-webpack-plugin/.npmignore:
--------------------------------------------------------------------------------
1 | .idea
2 | .DS_Store
3 | package-lock.json
4 |
5 | logs
6 | *.log
7 | npm-debug.log*
8 | yarn-debug.log*
9 | yarn-error.log*
10 |
11 | test
12 | node_modules
13 | coverage
--------------------------------------------------------------------------------
/packages/mp-webpack-plugin/README.md:
--------------------------------------------------------------------------------
1 | # mp-webpack-plugin
2 |
3 | ## 介绍
4 |
5 | 一个用于将 vue 组件转化成小程序代码的 webpack 插件。
6 |
7 | ## 安装
8 |
9 | ```
10 | npm install --save-dev mp-webpack-plugin
11 | ```
12 |
13 | ## 使用
14 |
15 | [查看文档](https://wechat-miniprogram.github.io/kbone/docs/guide/tutorial.html)。
16 |
--------------------------------------------------------------------------------
/packages/mp-webpack-plugin/src/tmpl/package.tmpl.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "miniprogram-project",
3 | "version": "0.0.1",
4 | "description": "miniprogram project",
5 | "dependencies": {
6 | "miniprogram-render": "latest",
7 | "miniprogram-element": "latest"
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/packages/mp-webpack-plugin/src/tmpl/page.tmpl.js:
--------------------------------------------------------------------------------
1 | const mp = require('miniprogram-render')
2 | const getBaseConfig = require('../base.js')
3 | const config = require('/* CONFIG_PATH */')
4 |
5 | /* INIT_FUNCTION */
6 |
7 | const baseConfig = getBaseConfig(mp, config, init)
8 |
9 | Component({
10 | ...baseConfig.base,
11 | methods: {
12 | ...baseConfig.methods,
13 | /* PAGE_SCROLL_FUNCTION */
14 | /* REACH_BOTTOM_FUNCTION */
15 | /* PULL_DOWN_REFRESH_FUNCTION */
16 | },
17 | })
18 |
--------------------------------------------------------------------------------
/packages/reduce-loader/.npmignore:
--------------------------------------------------------------------------------
1 | .idea
2 | .DS_Store
3 | package-lock.json
4 |
5 | logs
6 | *.log
7 | npm-debug.log*
8 | yarn-debug.log*
9 | yarn-error.log*
10 |
11 | test
12 | node_modules
13 | coverage
--------------------------------------------------------------------------------
/packages/reduce-loader/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # 更新日志
2 |
--------------------------------------------------------------------------------
/packages/reduce-loader/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "reduce-loader",
3 | "version": "0.3.2",
4 | "description": "a tool for develop miniprogram to reduce some code",
5 | "main": "src/index.js",
6 | "miniprogram": "src",
7 | "scripts": {},
8 | "repository": {
9 | "type": "git",
10 | "url": "https://github.com/wechat-miniprogram/kbone.git"
11 | },
12 | "author": "wechat-miniprogram",
13 | "license": "MIT"
14 | }
15 |
--------------------------------------------------------------------------------
/packages/reduce-loader/src/index.js:
--------------------------------------------------------------------------------
1 | const path = require('path')
2 |
3 | module.exports = function(source) {
4 | const extname = path.extname(this.resourcePath)
5 |
6 | // 处理在小程序端无用的代码
7 | if (/\.(tsx?|js)/ig.test(extname)) {
8 | return process.env.isMiniprogram ? '' : source
9 | }
10 |
11 | if (/\.vue/ig.test(extname)) {
12 | return process.env.isMiniprogram ? 'exports.__esModule=true;;exports.default={};' : source
13 | }
14 |
15 | return source
16 | }
17 |
--------------------------------------------------------------------------------
/packages/replace-global-var-loader/.npmignore:
--------------------------------------------------------------------------------
1 | .idea
2 | .DS_Store
3 | package-lock.json
4 |
5 | logs
6 | *.log
7 | npm-debug.log*
8 | yarn-debug.log*
9 | yarn-error.log*
10 |
11 | test
12 | node_modules
13 | coverage
--------------------------------------------------------------------------------
/packages/replace-global-var-loader/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # 更新日志
2 |
--------------------------------------------------------------------------------
/packages/replace-global-var-loader/README.md:
--------------------------------------------------------------------------------
1 | # replace-global-var-loader
2 |
3 | ## 介绍
4 |
5 | 一个用于替换全局变量的 webpack loader,用于给某些全局加上 window 调用前缀。
6 |
7 | ## 安装
8 |
9 | ```
10 | npm install --save-dev replace-global-var-loader
11 | ```
12 |
13 | ## 使用
14 |
15 | ```js
16 | // a.js
17 | abc = function () {
18 | console.log('abc')
19 | }
20 | ```
21 |
22 | ```js
23 | import 'replace-global-var-loader!./a.js'
24 | ```
25 |
26 | 那么 a.js 的代码会被转成:
27 |
28 | ```js
29 | // a.js
30 | window['abc'] = function () {
31 | console.log('abc')
32 | }
33 | ```
34 |
--------------------------------------------------------------------------------
/packages/replace-global-var-loader/test/index.test.js:
--------------------------------------------------------------------------------
1 | const loader = require('../src/index')
2 |
3 | test('replace-global-var-loader', () => {
4 | expect(loader(`
5 | abc = function() {
6 | console.log('abc')
7 | }
8 | `)).toBe(`
9 | window['abc'] = function() {
10 | console.log('abc')
11 | }
12 | `)
13 |
14 | expect(loader(`
15 | abc(wowo).ddd()
16 | Promise.then()
17 | `)).toBe(`
18 | window['abc'](window['wowo']).ddd()
19 | Promise.then()
20 | `)
21 | })
22 |
--------------------------------------------------------------------------------
/packages/vue-cli-plugin-kbone/.npmignore:
--------------------------------------------------------------------------------
1 | .idea
2 | .DS_Store
3 | package-lock.json
4 |
5 | logs
6 | *.log
7 | npm-debug.log*
8 | yarn-debug.log*
9 | yarn-error.log*
10 |
11 | test
12 | node_modules
13 | coverage
--------------------------------------------------------------------------------
/packages/vue-cli-plugin-kbone/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # 更新日志
2 |
3 | ## 1.4.1
4 |
5 | * 支持 configureWebpack 配置
6 |
7 | ## 0.9.13
8 |
9 | * 调整输出静态资源的名称
10 |
11 | ## 0.8.0
12 |
13 | * 修复 vue-cli 相关项目模板依赖升级后构建失败的问题
14 |
15 | ## 0.4.14
16 |
17 | * 支持输出除 project.config.json 之外文件的配置
18 |
19 | ## 0.4.13
20 |
21 | * 修复选择只输出页面相关文件时报错的问题
22 |
23 | ## 0.4.12
24 |
25 | * 暂时去除默认配置中的 useExtendedLib
26 |
27 | ## 0.4.1
28 |
29 | * 修复单页下 generator 报错问题
30 |
31 | ## 0.4.0
32 |
33 | * 调整 prompts,去掉一些较为细节的配置
34 | * 支持多入口
35 |
36 | ## 0.0.3
37 |
38 | * 调整 domSubTreeLevel 参数默认值为 10,支持范围为 1-10
39 |
--------------------------------------------------------------------------------
/packages/vue-cli-plugin-kbone/README.md:
--------------------------------------------------------------------------------
1 | # vue-cli-plugin-kbone
2 |
3 | ## 介绍
4 |
5 | 用于 [vue-cli](https://cli.vuejs.org/zh/guide/) 3.x 以上的 kbone 插件。
6 |
7 | ## 安装
8 |
9 | ```
10 | vue add kbone
11 | ```
12 |
13 | ## 生成文件
14 |
15 | * kbone 配置文件:[miniprogram.config.js](https://wechat-miniprogram.github.io/kbone/docs/config/)
16 | * 页面入口文件:默认是 src/main.mp.js,如果是多入口,则会读取项目根目录下的 vue.config.js,将入口文件生成到原入口文件同级目录下
17 |
18 | > 为什么需要生成页面入口文件?因为 kbone 要求页面入口文件必须暴露出 `createApp` 方法,以便在特定的时机进行 vue 实例的创建。
19 |
20 | ## 开发
21 |
22 | ```
23 | npm run dev:mp
24 | ```
25 |
26 | ## 构建
27 |
28 | ```
29 | npm run build:mp
30 | ```
31 |
--------------------------------------------------------------------------------
/packages/vue-cli-plugin-kbone/generator.js:
--------------------------------------------------------------------------------
1 | module.exports = require('./src/generator')
2 |
--------------------------------------------------------------------------------
/packages/vue-cli-plugin-kbone/index.js:
--------------------------------------------------------------------------------
1 | module.exports = require('./src')
2 |
--------------------------------------------------------------------------------
/packages/vue-cli-plugin-kbone/prompts.js:
--------------------------------------------------------------------------------
1 | module.exports = require('./src/prompts')
2 |
--------------------------------------------------------------------------------
/packages/vue-cli-plugin-kbone/src/defaultOptions.js:
--------------------------------------------------------------------------------
1 | const path = require('path')
2 |
3 | module.exports = {
4 | entry: '/',
5 | router: JSON.stringify({
6 | app: ['/'],
7 | }),
8 |
9 | projectName: path.basename(process.cwd()),
10 | cdnPath: '/',
11 | cdnLimit: 10 * 1024,
12 | entryFileName: 'main.mp.js',
13 |
14 | appWxss: 'default',
15 | autoBuildNpm: '\'npm\'',
16 | rem: false,
17 | }
18 |
--------------------------------------------------------------------------------
/packages/vue-improve-loader/.npmignore:
--------------------------------------------------------------------------------
1 | .idea
2 | .DS_Store
3 | package-lock.json
4 |
5 | logs
6 | *.log
7 | npm-debug.log*
8 | yarn-debug.log*
9 | yarn-error.log*
10 |
11 | test
12 | node_modules
13 | coverage
--------------------------------------------------------------------------------
/packages/vue-improve-loader/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # 更新日志
2 |
3 | ## 0.3.2
4 |
5 | * 属性名支持 #,以兼容具名插槽
6 |
7 | ## 0.0.6
8 |
9 | * 修复当存在 vue 组件名和 dom 标签名相同拼写时,check-reduce 失效问题
10 |
11 | ## 0.0.5
12 |
13 | * 放宽 parser 的规则,允许行内元素包含块级元素
14 |
--------------------------------------------------------------------------------
/packages/vue-improve-loader/README.md:
--------------------------------------------------------------------------------
1 | # vue-improve-loader
2 |
3 | ## 介绍
4 |
5 | 一个用于代 dom 树精简的 webpack loader。
6 |
7 | ## 安装
8 |
9 | ```
10 | npm install --save-dev vue-improve-loader
11 | ```
12 |
--------------------------------------------------------------------------------