Browse Source

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

Drjnigfubo 3 years ago
parent
commit
6706240393

+ 1 - 0
src/packages/__VUE/button/index.scss

@@ -15,6 +15,7 @@
   appearance: none;
   appearance: none;
   user-select: none;
   user-select: none;
   touch-action: manipulation;
   touch-action: manipulation;
+  vertical-align: bottom;
 
 
   -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
   -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
   -webkit-tap-highlight-color: transparent;
   -webkit-tap-highlight-color: transparent;

+ 4 - 9
src/packages/__VUE/col/index.vue

@@ -1,5 +1,5 @@
 <template>
 <template>
-  <view :class="classes" :style="style" @click="handleClick">
+  <view :class="classes" :style="style">
     <slot></slot>
     <slot></slot>
   </view>
   </view>
 </template>
 </template>
@@ -19,8 +19,8 @@ export default create({
       default: '0'
       default: '0'
     }
     }
   },
   },
-  emits: ['click'],
-  setup(props, { emit }) {
+  emits: [],
+  setup(props) {
     const prefixCls = componentName;
     const prefixCls = componentName;
     const gutter = inject('gutter') as number;
     const gutter = inject('gutter') as number;
     const classes = computed(() => {
     const classes = computed(() => {
@@ -37,14 +37,9 @@ export default create({
         paddingRight: gutter / 2 + 'px'
         paddingRight: gutter / 2 + 'px'
       };
       };
     });
     });
-    const handleClick = (evt: MouseEvent) => {
-      evt.stopPropagation();
-      emit('click', evt);
-    };
     return {
     return {
       classes,
       classes,
-      style,
-      handleClick
+      style
     };
     };
   }
   }
 });
 });

+ 20 - 5
src/packages/__VUE/icon/demo.vue

@@ -30,7 +30,7 @@
     <nut-cell-group v-for="item in icons.data" :title="currentLang == 'zh-CN' ? item.name : item.nameEn" :key="item">
     <nut-cell-group v-for="item in icons.data" :title="currentLang == 'zh-CN' ? item.name : item.nameEn" :key="item">
       <nut-cell>
       <nut-cell>
         <ul>
         <ul>
-          <li v-for="item in item.icons" :key="item">
+          <li v-for="item in item.icons" :key="item" @click="copyTag(item)">
             <nut-icon :name="item"></nut-icon>
             <nut-icon :name="item"></nut-icon>
             <span>{{ item }}</span>
             <span>{{ item }}</span>
           </li>
           </li>
@@ -40,7 +40,7 @@
     <nut-cell-group v-for="item in icons.style" :title="currentLang == 'zh-CN' ? item.name : item.nameEn" :key="item">
     <nut-cell-group v-for="item in icons.style" :title="currentLang == 'zh-CN' ? item.name : item.nameEn" :key="item">
       <nut-cell>
       <nut-cell>
         <ul>
         <ul>
-          <li v-for="it in item.icons" :key="it">
+          <li v-for="it in item.icons" :key="it" @click="copyTag(it['animation-name'])">
             <nut-icon :name="it.name" :class="`nut-icon-${it['animation-name']} nut-icon-${it['animation-time']}`">
             <nut-icon :name="it.name" :class="`nut-icon-${it['animation-name']} nut-icon-${it['animation-time']}`">
             </nut-icon>
             </nut-icon>
             <span>{{ it['animation-name'] }}</span>
             <span>{{ it['animation-name'] }}</span>
@@ -59,24 +59,39 @@ const initTranslate = () =>
       basic: '基本用法',
       basic: '基本用法',
       imageLink: '图片链接',
       imageLink: '图片链接',
       iconColor: '图标颜色',
       iconColor: '图标颜色',
-      iconSize: '图标大小'
+      iconSize: '图标大小',
+      copyToast: '复制成功'
     },
     },
     'en-US': {
     'en-US': {
       basic: 'Basic Usage',
       basic: 'Basic Usage',
       imageLink: 'Image Link',
       imageLink: 'Image Link',
       iconColor: 'Icon Color',
       iconColor: 'Icon Color',
-      iconSize: 'Icon Size'
+      iconSize: 'Icon Size',
+      copyToast: 'Copied successfully'
     }
     }
   });
   });
 // import icons from '@/packages/styles/font/iconfont.json';
 // import icons from '@/packages/styles/font/iconfont.json';
 import icons from '@/packages/styles/font/config.json';
 import icons from '@/packages/styles/font/config.json';
 import { createComponent } from '@/packages/utils/create';
 import { createComponent } from '@/packages/utils/create';
 const { createDemo, translate } = createComponent('icon');
 const { createDemo, translate } = createComponent('icon');
+import { Toast } from '@/packages/nutui.vue';
 export default createDemo({
 export default createDemo({
   props: {},
   props: {},
   setup() {
   setup() {
     initTranslate();
     initTranslate();
-    return { icons, translate, currentLang };
+    const copyTag = (name: string) => {
+      const text = `&lt;nut-icon name="${name}"&gt;&lt;/nut-icon&gt;`;
+      const input = document.createElement('input');
+      document.body.appendChild(input);
+      input.setAttribute('value', text);
+      input.select();
+      if (document.execCommand('copy')) {
+        document.execCommand('copy');
+        Toast.text(`${translate('copyToast')}: <br/>${text}`);
+      }
+      document.body.removeChild(input);
+    };
+    return { icons, translate, currentLang, copyTag };
   }
   }
 });
 });
 </script>
 </script>

+ 26 - 0
src/packages/__VUE/list/doc.en-US.md

@@ -60,6 +60,32 @@ export default {
   }
   }
 };
 };
 </script>
 </script>
+<style lang="scss">
+body {
+  width: 100%;
+  height: 100vh;
+}
+#app {
+  width: 100%;
+  height: 100%;
+}
+.demo {
+  height: 100%;
+  .nut-cell {
+    height: 100%;
+  }
+  .list-item {
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    width: 100%;
+    height: 50px;
+    margin-bottom: 10px;
+    background-color: #f4a8b6;
+    border-radius: 10px;
+  }
+}
+</style>
 ```
 ```
 
 
 :::
 :::

+ 26 - 0
src/packages/__VUE/list/doc.md

@@ -60,6 +60,32 @@ export default {
   }
   }
 };
 };
 </script>
 </script>
+<style lang="scss">
+body {
+  width: 100%;
+  height: 100vh;
+}
+#app {
+  width: 100%;
+  height: 100%;
+}
+.demo {
+  height: 100%;
+  .nut-cell {
+    height: 100%;
+  }
+  .list-item {
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    width: 100%;
+    height: 50px;
+    margin-bottom: 10px;
+    background-color: #f4a8b6;
+    border-radius: 10px;
+  }
+}
+</style>
 ```
 ```
 
 
 :::
 :::

+ 1 - 0
src/packages/__VUE/radio/index.scss

@@ -55,6 +55,7 @@
   }
   }
 
 
   &__label {
   &__label {
+    flex: 1;
     margin-left: $radio-label-margin-left;
     margin-left: $radio-label-margin-left;
     font-size: $radio-label-font-size;
     font-size: $radio-label-font-size;
     color: $radio-label-font-color;
     color: $radio-label-font-color;

+ 4 - 9
src/packages/__VUE/row/index.vue

@@ -1,5 +1,5 @@
 <template>
 <template>
-  <view :class="getClasses()" @click="handleClick">
+  <view :class="getClasses()">
     <slot></slot>
     <slot></slot>
   </view>
   </view>
 </template>
 </template>
@@ -31,8 +31,8 @@ export default create({
       default: 'nowrap'
       default: 'nowrap'
     }
     }
   },
   },
-  emits: ['click'],
-  setup(props, { emit }) {
+  emits: [],
+  setup(props) {
     const prefixCls = componentName;
     const prefixCls = componentName;
     provide('gutter', props.gutter);
     provide('gutter', props.gutter);
     const getClass = (prefix: string, type: string) => {
     const getClass = (prefix: string, type: string) => {
@@ -47,13 +47,8 @@ export default create({
               ${prefixCls}
               ${prefixCls}
               `;
               `;
     };
     };
-    const handleClick = (evt: MouseEvent) => {
-      evt.stopPropagation();
-      emit('click', evt);
-    };
     return {
     return {
-      getClasses,
-      handleClick
+      getClasses
     };
     };
   }
   }
 });
 });