Skip to content

Commit

Permalink
docs: taro md
Browse files Browse the repository at this point in the history
  • Loading branch information
szg2008 committed Jun 22, 2021
1 parent 0251a58 commit 4fe5fed
Show file tree
Hide file tree
Showing 15 changed files with 48 additions and 23 deletions.
8 changes: 3 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
{
"name": "@nutui/nutui",
"version": "3.0.0",
"npm": {
"tag": "next"
},
"version": "3.0.1",
"description": "京东风格的轻量级移动端 Vue 组件库",
"main": "dist/nutui.umd.js",
"module": "dist/nutui.es.js",
Expand Down Expand Up @@ -49,7 +46,8 @@
"serve": "vite preview",
"upload": "yarn build:site:oss && node ./jd/upload.js",
"add": "node jd/createComponentMode.js",
"publish:beta": "npm publish --tag=beta",
"publish:next": "npm publish --tag=next",
"publish:taro": "npm publish --tag=taro",
"generate:file": "node jd/generate-nutui.js",
"generate:file:taro:vue": "node jd/generate-nutui-taro-vue.js",
"generate:types": "node jd/generate-types.js",
Expand Down
3 changes: 3 additions & 0 deletions src/packages/__VUE/button/doc.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@

``` javascript
import { createApp } from 'vue';
//vue
import { Button } from '@nutui/nutui';
//mp
import { Button } from '@nutui/nutui@taro';

const app = createApp();
app.use(Button);
Expand Down
3 changes: 3 additions & 0 deletions src/packages/__VUE/checkbox/doc.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@

``` ts
import { createApp } from 'vue';
//vue
import { Checkbox } from '@nutui/nutui';
//mp
import { Checkbox } from '@nutui/nutui@taro';

const app = createApp();
app.use(Checkbox);
Expand Down
3 changes: 3 additions & 0 deletions src/packages/__VUE/layout/doc.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@

``` javascript
import { createApp } from 'vue';
//vue
import { Layout } from '@nutui/nutui';
//mp
import { Layout } from '@nutui/nutui@taro';

const app = createApp();
app.use(Layout);
Expand Down
3 changes: 3 additions & 0 deletions src/packages/__VUE/navbar/doc.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@
```javascript

import { createApp } from 'vue';
//vue
import { Navbar } from '@nutui/nutui';
//mp
import { Navbar } from '@nutui/nutui@taro';

const app = createApp();
app.use(Navbar);
Expand Down
3 changes: 3 additions & 0 deletions src/packages/__VUE/overlay/doc.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@

```javascript
import { createApp } from 'vue';
//vue
import { OverLay } from '@nutui/nutui';
//mp
import { OverLay } from '@nutui/nutui@taro';

const app = createApp();
app.use(OverLay);
Expand Down
3 changes: 3 additions & 0 deletions src/packages/__VUE/radio/doc.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@

``` ts
import { createApp } from 'vue';
//vue
import { Radio } from '@nutui/nutui';
//mp
import { Radio } from '@nutui/nutui@taro';

const app = createApp();
app.use(Radio);
Expand Down
3 changes: 3 additions & 0 deletions src/packages/__VUE/steps/doc.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@

```javascript
import { createApp } from 'vue';
//vue
import { Steps } from '@nutui/nutui';
//mp
import { Steps } from '@nutui/nutui@taro';

const app = createApp();
app.use(Steps);
Expand Down
3 changes: 0 additions & 3 deletions src/packages/__VUE/swiper/doc.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@

```javascript
import { createApp } from 'vue';
//vue
import { Swiper } from '@nutui/nutui';
//vue-taro
import { Swiper } from '@nutui/nutui@taro';

const app = createApp();
app.use(Swiper);
Expand Down
3 changes: 3 additions & 0 deletions src/packages/__VUE/switch/doc.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@

``` javascript
import { createApp } from 'vue';
//vue
import { Switch } from '@nutui/nutui';
//mp
import { Switch } from '@nutui/nutui@taro';
const app = createApp();
app.use(Switch);

Expand Down
7 changes: 5 additions & 2 deletions src/packages/__VUE/tabbar/doc.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@

``` javascript
import { createApp } from 'vue';
import { Tabbar,Icon } from '@nutui/nutui';
//vue
import { Tabbar } from '@nutui/nutui';
//mp
import { Tabbar } from '@nutui/nutui@taro';

const app = createApp();
app.use(Tabbar).use(Icon);
app.use(Tabbar);

```

Expand Down
19 changes: 10 additions & 9 deletions src/sites/doc/components/Search.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ export default defineComponent({
});
onMounted(() => {
// console.log('nav', nav);
nav.forEach(item => {
item.packages.forEach(value => {
nav.forEach((item) => {
item.packages.forEach((value) => {
// console.log('value', value)
data.navList.push(value);
});
Expand All @@ -50,9 +50,9 @@ export default defineComponent({
});
watch(
() => data.searchVal,
sVal => {
(sVal) => {
if (sVal) {
data.searchList = data.navList.filter(item => {
data.searchList = data.navList.filter((item) => {
if (item.show === false) return false;
// console.log('item', item);
const rx = new RegExp(sVal, 'gi');
Expand All @@ -67,10 +67,10 @@ export default defineComponent({
// console.log(data.searchList)
}
);
const onfocus = e => {
const onfocus = (e) => {
// e.target.select();
};
const onblur = e => {
const onblur = (e) => {
setTimeout(() => {
data.searchList = [];
data.searchVal = '';
Expand All @@ -81,7 +81,7 @@ export default defineComponent({
data.searchCurName = '';
data.searchIndex = 0;
};
const choseList = e => {
const choseList = (e) => {
let searchIndex = data.searchIndex;
if (e.keyCode == 40) {
searchIndex++;
Expand Down Expand Up @@ -130,8 +130,9 @@ export default defineComponent({
padding-left: 42px;
font-size: 14px;
vertical-align: middle;
background: transparent url('../../assets/images/input-search.png')
no-repeat;
background-color: transparent;
background-image: url('../../assets/images/input-search.png');
background-repeat: no-repeat;
font-size: 14px;
color: #fff;
&:focus {
Expand Down
6 changes: 3 additions & 3 deletions src/sites/doc/views/Index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
>
</div>
<div class="doc-content-tabs" v-if="isShow() && !isShowTaroDoc">
<div class="tab-item cur">Vue/Taro</div>
<div class="tab-item cur">vue/mp</div>
</div>
<router-view />
</div>
Expand Down Expand Up @@ -55,11 +55,11 @@ export default defineComponent({
tabs: [
{
key: 'vue',
text: 'Vue'
text: 'vue'
},
{
key: 'taro',
text: 'Vue - Taro'
text: 'mp'
}
]
});
Expand Down
2 changes: 2 additions & 0 deletions src/sites/mobile-taro/vue/src/app.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { createApp } from 'vue';
import './app.scss';
import NutUI from '../../../../packages/nutui.taro.vue';
// import NutUI from '@nutui/nutui';
// import '@nutui/nutui/dist/style.css';
const App = createApp({
onShow(options) {}
// 入口组件不需要实现 render 方法,即使实现了也会被 taro 所覆盖
Expand Down
2 changes: 1 addition & 1 deletion src/sites/mobile-taro/vue/src/pages/popup/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -137,4 +137,4 @@ export default {
};
</script>

<style lang="scss" scoped></style>
<style lang="scss"></style>

0 comments on commit 4fe5fed

Please sign in to comment.