Browse Source

Merge branch 'v4' of https://github.com/jdf2e/nutui into v4

suzigang 3 years ago
parent
commit
d2526e6ae1

+ 1 - 1
.github/workflows/sync-gitcode.yml

@@ -2,7 +2,7 @@ name: Sync to Gitcode
 
 on:
   push:
-    branches: [next]
+    branches: [v4]
 
 jobs:
   deploy-site-sync-gitcode:

+ 1 - 1
.github/workflows/sync-gitee.yml

@@ -2,7 +2,7 @@ name: Sync to Gitee
 
 on:
   push:
-    branches: [next]
+    branches: [v4]
 
 jobs:
   deploy-site-sync-gitee:

+ 2 - 2
README.md

@@ -37,7 +37,7 @@
     <img src="https://img.shields.io/github/issues-closed/jdf2e/nutui" alt="GitHub closed issues">
     </a>  
     <a href="https://github.com/jdf2e/nutui">
-    <img src="https://img.shields.io/github/commits-since/jdf2e/nutui/latest/next" alt="GitHub commits since latest release (by date)">
+    <img src="https://img.shields.io/github/commits-since/jdf2e/nutui/latest/v4" alt="GitHub commits since latest release (by date)">
     </a>
     <a href="https://github.com/jdf2e/nutui">
     <img src="https://img.shields.io/github/release-date/jdf2e/nutui" alt="GitHub Release Date">
@@ -109,7 +109,7 @@ createApp(App).use(NutUI).mount("#app");
 
 [NutUI 实战快速入门](https://www.bilibili.com/video/BV14r4y1e7LK/?spm_id_from=333.999.0.0&vd_source=339cf5dcca71ec2905c729fd92bba8a9)
 
-[awesome-nutui](https://github.com/jdf2e/nutui/blob/next/awesome.md)
+[awesome-nutui](https://github.com/jdf2e/nutui/blob/v4/awesome.md)
 
 
 ## 主题

+ 2 - 2
README_EN.md

@@ -37,7 +37,7 @@
     <img src="https://img.shields.io/github/issues-closed/jdf2e/nutui" alt="GitHub closed issues">
     </a>  
     <a href="https://github.com/jdf2e/nutui">
-    <img src="https://img.shields.io/github/commits-since/jdf2e/nutui/latest/next" alt="GitHub commits since latest release (by date)">
+    <img src="https://img.shields.io/github/commits-since/jdf2e/nutui/latest/v4" alt="GitHub commits since latest release (by date)">
     </a>
     <a href="https://github.com/jdf2e/nutui">
     <img src="https://img.shields.io/github/release-date/jdf2e/nutui" alt="GitHub Release Date">
@@ -109,7 +109,7 @@ createApp(App).use(NutUI).mount("#app");
 
 [NutUI Quick Start](https://www.bilibili.com/video/BV14r4y1e7LK)
 
-[Awesome-NutUI](https://github.com/jdf2e/nutui/blob/next/awesome.md)
+[Awesome-NutUI](https://github.com/jdf2e/nutui/blob/v4/awesome.md)
 
 
 ## Themes

+ 1 - 1
src/packages/__VUE/range/index.vue

@@ -78,7 +78,7 @@ import { ref, toRefs, computed, PropType, CSSProperties } from 'vue';
 import { createComponent } from '@/packages/utils/create';
 import { useTouch } from '@/packages/utils/useTouch';
 import { useRect } from '@/packages/utils/useRect';
-import { isArray } from '@vue/shared';
+import { isArray } from '@/packages/utils/util';
 const { componentName, create } = createComponent('range');
 
 export default create({

+ 5 - 4
src/packages/__VUE/swiper/demo.vue

@@ -61,10 +61,10 @@
       </nut-swiper>
       <view class="nut-swiper-btns">
         <span class="nut-swiper-btns__left" @click="handlePrev">
-          <nut-icon name="left"></nut-icon>
+          <Left></Left>
         </span>
         <span class="nut-swiper-btns__left" @click="handleNext">
-          <nut-icon name="right"></nut-icon>
+          <Right></Right>
         </span>
       </view>
     </view>
@@ -115,6 +115,7 @@ import { reactive, toRefs, onMounted, ref, Ref } from 'vue';
 import { createComponent } from '@/packages/utils/create';
 const { createDemo, translate } = createComponent('swiper');
 import { useTranslate } from '@/sites/assets/util/useTranslate';
+import { Left, Right } from '@nutui/icons-vue';
 const initTranslate = () =>
   useTranslate({
     'zh-CN': {
@@ -180,7 +181,6 @@ export default createDemo({
     const handleNext = () => {
       swiper.value.next();
     };
-
     onMounted(() => {
       setTimeout(() => {
         state.list1 = state.list.slice();
@@ -196,7 +196,8 @@ export default createDemo({
       handleNext,
       translate
     };
-  }
+  },
+  components: { Left, Right }
 });
 </script>
 

+ 7 - 3
src/packages/__VUE/swiper/doc.en-US.md

@@ -283,7 +283,7 @@ You can manually switch through `api` (`prev`, `next`)
 
 :::demo
 
-```html
+```vue
 <template>
   <view class="demo-box">
     <nut-swiper :init-page="page" :loop="true" ref="swiper">
@@ -293,10 +293,10 @@ You can manually switch through `api` (`prev`, `next`)
     </nut-swiper>
     <view class="nut-swiper-btns">
       <span class="nut-swiper-btns__left" @click="handlePrev">
-        <nut-icon name='left'></nut-icon>
+        <Left></Left>
       </span>
       <span class="nut-swiper-btns__left" @click="handleNext">
-        <nut-icon name='right'></nut-icon>
+        <Right></Right>
       </span>
     </view>
   </view>
@@ -304,6 +304,10 @@ You can manually switch through `api` (`prev`, `next`)
 <script lang="ts">
   import { reactive, toRefs, ref, Ref } from 'vue';
   export default {
+    components: { 
+      Left, 
+      Right 
+    },
     setup() {
       const swiper = ref(null) as Ref;
       const state = reactive({

+ 8 - 3
src/packages/__VUE/swiper/doc.md

@@ -283,7 +283,7 @@ app.use(SwiperItem);
 
 :::demo
 
-```html
+```vue
 <template>
   <view class="demo-box">
     <nut-swiper :init-page="page" :loop="true" ref="swiper">
@@ -293,17 +293,22 @@ app.use(SwiperItem);
     </nut-swiper>
     <view class="nut-swiper-btns">
       <span class="nut-swiper-btns__left" @click="handlePrev">
-        <nut-icon name='left'></nut-icon>
+        <Left></Left>
       </span>
       <span class="nut-swiper-btns__left" @click="handleNext">
-        <nut-icon name='right'></nut-icon>
+        <Right></Right>
       </span>
     </view>
   </view>
 </template>
 <script lang="ts">
   import { reactive, toRefs, ref, Ref } from 'vue';
+  import { Left, Right } from '@nutui/icons-vue';
   export default {
+    components: { 
+      Left, 
+      Right 
+    },
     setup() {
       const swiper = ref(null) as Ref;
       const state = reactive({

+ 3 - 3
src/packages/__VUE/table/__tests__/index.spec.ts

@@ -1,12 +1,12 @@
 import { mount, config } from '@vue/test-utils';
 import Table from '../index.vue';
 import { nextTick, h } from 'vue';
-import NutIcon from '../../icon/index.vue';
+import { Dongdong } from '@nutui/icons-vue';
 import NutButton from '../../button/index.vue';
 
 beforeAll(() => {
   config.global.components = {
-    NutIcon,
+    Dongdong,
     NutButton
   };
 });
@@ -97,7 +97,7 @@ const data2 = [
     sex: '女',
     record: '本科',
     render: () => {
-      return h(NutIcon, { name: 'dongdong', size: '14px' });
+      return h(Dongdong, { width: '14px', height: '14px' });
     }
   },
   {

+ 3 - 1
src/packages/__VUE/table/common.ts

@@ -1,11 +1,13 @@
 import { computed, PropType, reactive, toRefs, watch } from 'vue';
 import RenderColumn from './renderColumn';
+import { DownArrow } from '@nutui/icons-vue';
 import { TableColumnProps } from './types';
 
 export const component = (componentName: string, translate: Function) => {
   return {
     components: {
-      RenderColumn
+      RenderColumn,
+      DownArrow
     },
     props: {
       bordered: {

+ 3 - 3
src/packages/__VUE/table/demo.vue

@@ -31,7 +31,7 @@ import { createComponent } from '@/packages/utils/create';
 import { TableColumnProps } from './types';
 import { Toast } from '@/packages/nutui.vue';
 import Button from '@/packages/__VUE/button/index.vue';
-import Icon from '@/packages/__VUE/icon/index.vue';
+import { Dongdong } from '@nutui/icons-vue';
 const { createDemo, translate } = createComponent('table');
 import { useTranslate } from '@/sites/assets/util/useTranslate';
 const initTranslate = () =>
@@ -94,7 +94,7 @@ const initTranslate = () =>
 export default createDemo({
   components: {
     Button,
-    Icon
+    Dongdong
   },
   props: {},
   setup(props, { emit, slot }) {
@@ -274,7 +274,7 @@ export default createDemo({
           sex: translate('woman'),
           record: translate('undergraduate'),
           render: () => {
-            return h(Icon, { name: 'dongdong', size: '14px' });
+            return h(Dongdong, { width: '14px', height: '14px' });
           }
         },
         {

+ 3 - 2
src/packages/__VUE/table/doc.en-US.md

@@ -376,7 +376,8 @@ app.use(Table);
 </template>
 <script lang="ts">
   import { reactive, toRefs, h } from 'vue';
-  import { Button, Icon } from '@nutui/nutui';
+  import { Button } from '@nutui/nutui';
+  import { Dongdong } from '@nutui/icons-vue';
   export default {
     setup() {
       const state = reactive({
@@ -423,7 +424,7 @@ app.use(Table);
             sex: 'woman',
             record: 'undergraduate',
             render: () => {
-              return h(Icon, { name: 'dongdong', size: '14px' });
+              return h(Dongdong, {  width: '14px',height:'14px' });
             }
           },
           {

+ 3 - 2
src/packages/__VUE/table/doc.md

@@ -376,7 +376,8 @@ app.use(Table);
 </template>
 <script lang="ts">
   import { reactive, toRefs, h } from 'vue';
-  import { Button, Icon } from '@nutui/nutui';
+  import { Button } from '@nutui/nutui';
+   import { Dongdong } from '@nutui/icons-vue';
   export default {
     setup() {
       const state = reactive({
@@ -423,7 +424,7 @@ app.use(Table);
             sex: '女',
             record: '本科',
             render: () => {
-              return h(Icon, { name: 'dongdong', size: '14px' });
+              return h(Dongdong, {  width: '14px',height:'14px '});
             }
           },
           {

+ 1 - 1
src/packages/__VUE/table/index.taro.vue

@@ -13,7 +13,7 @@
           >
             {{ item.title }}
             <slot name="icon"></slot>
-            <nut-icon v-if="!$slots.icon && item.sorter" name="down-arrow" size="12px"></nut-icon>
+            <DownArrow v-if="!$slots.icon && item.sorter" width="12px" height="12px"></DownArrow>
           </span>
         </view>
       </view>

+ 1 - 1
src/packages/__VUE/table/index.vue

@@ -13,7 +13,7 @@
           >
             {{ item.title }}
             <slot name="icon"></slot>
-            <nut-icon v-if="!$slots.icon && item.sorter" name="down-arrow" size="12px"></nut-icon>
+            <DownArrow v-if="!$slots.icon && item.sorter" width="12px" height="12px"></DownArrow>
           </span>
         </view>
       </view>

+ 1 - 1
src/packages/__VUE/uploader/doc.en-US.md

@@ -300,7 +300,7 @@ export default {
 import { ref } from 'vue';
 export default {
   setup() {
-      // source file https://github.com/jdf2e/nutui/blob/next/src/packages/__VUE/uploader/uploader.ts#L51
+      // source file https://github.com/jdf2e/nutui/blob/v4/src/packages/__VUE/uploader/uploader.ts#L51
      const beforeXhrUpload=(xhr:XMLHttpRequest,options:any)=>{
         if (options.method.toLowerCase() == 'put') {
           xhr.send(options.sourceFile);

+ 1 - 1
src/packages/__VUE/uploader/doc.md

@@ -300,7 +300,7 @@ export default {
 import { ref } from 'vue';
 export default {
   setup() {
-    // source file https://github.com/jdf2e/nutui/blob/next/src/packages/__VUE/uploader/uploader.ts#L51
+    // source file https://github.com/jdf2e/nutui/blob/v4/src/packages/__VUE/uploader/uploader.ts#L51
      const beforeXhrUpload=(xhr:XMLHttpRequest,options:any)=>{
         if (options.method.toLowerCase() == 'put') {
           xhr.send(options.sourceFile);

+ 1 - 1
src/packages/__VUE/uploader/doc.taro.md

@@ -90,7 +90,7 @@ app.use(Progress);
 import { ref } from 'vue';
 export default {
   setup() {
-    // source file https://github.com/jdf2e/nutui/blob/next/src/packages/__VUE/uploader/uploader.ts#L6
+    // source file https://github.com/jdf2e/nutui/blob/v4/src/packages/__VUE/uploader/uploader.ts#L6
     const beforeXhrUpload = (taroUploadFile: any, options: any) => {
       //taroUploadFile  是 Taro.uploadFile , 你也可以自定义设置其它函数
       const uploadTask = taroUploadFile({

+ 2 - 2
src/packages/locale/README.md

@@ -10,13 +10,13 @@
 | 简体中文     | zh-CN  | `v3.1.19` |
 | 繁體中文     | zh-TW  | `v3.1.19` |
 
-> 在 [这里](https://github.com/jdf2e/nutui/tree/next/src/packages/locale/lang) 查看所有的语言包源文件。
+> 在 [这里](https://github.com/jdf2e/nutui/tree/v4/src/packages/locale/lang) 查看所有的语言包源文件。
 
 ## 常见问题
 
 ### 找不到所需的语言包?
 
-如果上方列表中没有你需要的语言,欢迎给我们提 Pull Request 来增加新的语言包。改动内容可以参考 [语言包](https://github.com/jdf2e/nutui/tree/next/src/packages/locale/lang) 语言包 的 PR
+如果上方列表中没有你需要的语言,欢迎给我们提 Pull Request 来增加新的语言包。改动内容可以参考 [语言包](https://github.com/jdf2e/nutui/tree/v4/src/packages/locale/lang) 语言包 的 PR
 
 ### 业务代码如何实现国际化?
 

+ 5 - 3
src/sites/mobile-taro/vue/src/exhibition/pages/swiper/index.vue

@@ -63,10 +63,10 @@
       </nut-swiper>
       <view class="nut-swiper-btns">
         <span class="nut-swiper-btns__left" @click="handlePrev">
-          <nut-icon name="left"></nut-icon>
+          <Left></Left>
         </span>
         <span class="nut-swiper-btns__left" @click="handleNext">
-          <nut-icon name="right"></nut-icon>
+          <Right></Right>
         </span>
       </view>
     </view>
@@ -114,6 +114,7 @@
 
 <script lang="ts">
 import { reactive, toRefs, onMounted, ref, Ref } from 'vue';
+import { Left, Right } from '@nutui/icons-vue';
 
 export default {
   props: {},
@@ -166,7 +167,8 @@ export default {
       handlePrev,
       handleNext
     };
-  }
+  },
+  components: { Left, Right }
 };
 </script>