Browse Source

chore(pagination): use icons-vue component

richard1015 3 years ago
parent
commit
3d46443064

+ 4 - 2
src/packages/__VUE/pagination/demo.vue

@@ -9,10 +9,10 @@
     <h2>{{ translate('customButton') }}</h2>
     <h2>{{ translate('customButton') }}</h2>
     <nut-pagination v-model="currentPage3" :total-items="500" :show-page-size="5" @change="pageChange">
     <nut-pagination v-model="currentPage3" :total-items="500" :show-page-size="5" @change="pageChange">
       <template #prev-text>
       <template #prev-text>
-        <nut-icon name="left" size="10px" />
+        <Left width="10px" height="10px" />
       </template>
       </template>
       <template #next-text>
       <template #next-text>
-        <nut-icon name="right" size="10px" />
+        <Right width="10px" height="10px" />
       </template>
       </template>
       <template #page="{ item }">
       <template #page="{ item }">
         {{ item.number == 3 ? 'hot' : item.text }}
         {{ item.number == 3 ? 'hot' : item.text }}
@@ -26,6 +26,7 @@ import { reactive, toRefs } from 'vue';
 import { createComponent } from '@/packages/utils/create';
 import { createComponent } from '@/packages/utils/create';
 const { createDemo, translate } = createComponent('pagination');
 const { createDemo, translate } = createComponent('pagination');
 import { useTranslate } from '@/sites/assets/util/useTranslate';
 import { useTranslate } from '@/sites/assets/util/useTranslate';
+import { Left, Right } from '@nutui/icons-vue';
 const initTranslate = () =>
 const initTranslate = () =>
   useTranslate({
   useTranslate({
     'zh-CN': {
     'zh-CN': {
@@ -42,6 +43,7 @@ const initTranslate = () =>
     }
     }
   });
   });
 export default createDemo({
 export default createDemo({
+  components: { Left, Right },
   setup() {
   setup() {
     initTranslate();
     initTranslate();
     const state = reactive({
     const state = reactive({

+ 4 - 2
src/packages/__VUE/pagination/doc.en-US.md

@@ -117,10 +117,10 @@ Custom pagination button content with pre-text slot、next-text slot and so on.
 <template>
 <template>
   <nut-pagination v-model="currentPage3" :total-items="500"  @change="pageChange"  :show-page-size="5">
   <nut-pagination v-model="currentPage3" :total-items="500"  @change="pageChange"  :show-page-size="5">
       <template #prev-text>
       <template #prev-text>
-          <nut-icon name="left" size="10px" />
+        <Left width="10px" height="10px" />
       </template>
       </template>
       <template #next-text>
       <template #next-text>
-          <nut-icon name="right" size="10px" />
+        <Right width="10px" height="10px" />
       </template>
       </template>
       <template #page="{ item }">
       <template #page="{ item }">
           {{ item.number == 3 ? 'hot' : item.text }}
           {{ item.number == 3 ? 'hot' : item.text }}
@@ -128,8 +128,10 @@ Custom pagination button content with pre-text slot、next-text slot and so on.
   </nut-pagination>
   </nut-pagination>
 </template>
 </template>
 <script lang="ts">
 <script lang="ts">
+import { Left, Right } from '@nutui/icons-vue-taro';
 import { ref, reactive, toRefs } from 'vue';
 import { ref, reactive, toRefs } from 'vue';
 export default {
 export default {
+  components: { Left, Right },
   setup() {
   setup() {
     const state = reactive({
     const state = reactive({
       currentPage3: 1,
       currentPage3: 1,

+ 4 - 2
src/packages/__VUE/pagination/doc.md

@@ -117,10 +117,10 @@ export default {
 <template>
 <template>
   <nut-pagination v-model="currentPage3" :total-items="500"  @change="pageChange"  :show-page-size="5">
   <nut-pagination v-model="currentPage3" :total-items="500"  @change="pageChange"  :show-page-size="5">
       <template #prev-text>
       <template #prev-text>
-          <nut-icon name="left" size="10px" />
+        <Left width="10px" height="10px" />
       </template>
       </template>
       <template #next-text>
       <template #next-text>
-          <nut-icon name="right" size="10px" />
+        <Right width="10px" height="10px" />
       </template>
       </template>
       <template #page="{ item }">
       <template #page="{ item }">
           {{ item.number == 3 ? 'hot' : item.text }}
           {{ item.number == 3 ? 'hot' : item.text }}
@@ -128,8 +128,10 @@ export default {
   </nut-pagination>
   </nut-pagination>
 </template>
 </template>
 <script lang="ts">
 <script lang="ts">
+import { Left, Right } from '@nutui/icons-vue';
 import { ref, reactive, toRefs } from 'vue';
 import { ref, reactive, toRefs } from 'vue';
 export default {
 export default {
+  components: { Left, Right },
   setup() {
   setup() {
     const state = reactive({
     const state = reactive({
       currentPage3: 1,
       currentPage3: 1,

+ 5 - 3
src/sites/mobile-taro/vue/src/nav/pages/pagination/index.vue

@@ -9,10 +9,10 @@
     <h2>自定义按钮</h2>
     <h2>自定义按钮</h2>
     <nut-pagination v-model="currentPage3" :total-items="500" :show-page-size="5" @change="pageChange">
     <nut-pagination v-model="currentPage3" :total-items="500" :show-page-size="5" @change="pageChange">
       <template #prev-text>
       <template #prev-text>
-        <nut-icon name="left" size="10px" />
+        <Left width="10px" height="10px" />
       </template>
       </template>
       <template #next-text>
       <template #next-text>
-        <nut-icon name="right" size="10px" />
+        <Right width="10px" height="10px" />
       </template>
       </template>
       <template #page="{ item }">
       <template #page="{ item }">
         {{ item.number == 3 ? 'hot' : item.text }}
         {{ item.number == 3 ? 'hot' : item.text }}
@@ -22,8 +22,10 @@
 </template>
 </template>
 
 
 <script lang="ts">
 <script lang="ts">
-import { ref, reactive, toRefs, defineComponent } from 'vue';
+import { Left, Right } from '@nutui/icons-vue-taro';
+import { reactive, toRefs, defineComponent } from 'vue';
 export default defineComponent({
 export default defineComponent({
+  components: { Left, Right },
   setup() {
   setup() {
     const state = reactive({
     const state = reactive({
       currentPage: 1,
       currentPage: 1,