mirror of
https://github.com/element-plus/element-plus.git
synced 2026-03-13 07:51:17 +08:00
feat(docs): Pagination code for composition (#2329)
Co-authored-by: xing.wu <wuxing@bjca.org.cn>
This commit is contained in:
@@ -137,6 +137,33 @@ Add more modules based on your scenario.
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<!--
|
||||
<setup>
|
||||
|
||||
import { defineComponent, ref } from 'vue';
|
||||
|
||||
export default defineComponent({
|
||||
setup() {
|
||||
const handleSizeChange = (val) => {
|
||||
console.log(`${val} items per page`);
|
||||
};
|
||||
const handleCurrentChange = (val) => {
|
||||
console.log(`current page: ${val}`);
|
||||
};
|
||||
|
||||
return {
|
||||
currentPage1: ref(5),
|
||||
currentPage2: ref(5),
|
||||
currentPage3: ref(5),
|
||||
currentPage4: ref(4),
|
||||
handleSizeChange,
|
||||
handleCurrentChange,
|
||||
};
|
||||
},
|
||||
});
|
||||
|
||||
</setup>
|
||||
-->
|
||||
```
|
||||
:::
|
||||
|
||||
@@ -165,6 +192,21 @@ When there is only one page, hide the pagination by setting the `hide-on-single-
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<!--
|
||||
<setup>
|
||||
|
||||
import { defineComponent, ref } from 'vue';
|
||||
|
||||
export default defineComponent({
|
||||
setup() {
|
||||
return {
|
||||
value: ref(false),
|
||||
};
|
||||
},
|
||||
});
|
||||
|
||||
</setup>
|
||||
-->
|
||||
```
|
||||
:::
|
||||
|
||||
|
||||
@@ -124,6 +124,33 @@ Agrega más módulos basados en su escenario.
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<!--
|
||||
<setup>
|
||||
|
||||
import { defineComponent, ref } from 'vue';
|
||||
|
||||
export default defineComponent({
|
||||
setup() {
|
||||
const handleSizeChange = (val) => {
|
||||
console.log(`${val} items per page`);
|
||||
};
|
||||
const handleCurrentChange = (val) => {
|
||||
console.log(`current page: ${val}`);
|
||||
};
|
||||
|
||||
return {
|
||||
currentPage1: ref(5),
|
||||
currentPage2: ref(5),
|
||||
currentPage3: ref(5),
|
||||
currentPage4: ref(4),
|
||||
handleSizeChange,
|
||||
handleCurrentChange,
|
||||
};
|
||||
},
|
||||
});
|
||||
|
||||
</setup>
|
||||
-->
|
||||
```
|
||||
|
||||
:::
|
||||
@@ -152,6 +179,21 @@ Cuando sólo hay una página, oculte la paginación configurando el atributo `hi
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<!--
|
||||
<setup>
|
||||
|
||||
import { defineComponent, ref } from 'vue';
|
||||
|
||||
export default defineComponent({
|
||||
setup() {
|
||||
return {
|
||||
value: ref(false),
|
||||
};
|
||||
},
|
||||
});
|
||||
|
||||
</setup>
|
||||
-->
|
||||
```
|
||||
:::
|
||||
|
||||
|
||||
@@ -141,6 +141,33 @@ Vous pouvez ajouter plus de modules suivant vos besoins.
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<!--
|
||||
<setup>
|
||||
|
||||
import { defineComponent, ref } from 'vue';
|
||||
|
||||
export default defineComponent({
|
||||
setup() {
|
||||
const handleSizeChange = (val) => {
|
||||
console.log(`${val} items per page`);
|
||||
};
|
||||
const handleCurrentChange = (val) => {
|
||||
console.log(`current page: ${val}`);
|
||||
};
|
||||
|
||||
return {
|
||||
currentPage1: ref(5),
|
||||
currentPage2: ref(5),
|
||||
currentPage3: ref(5),
|
||||
currentPage4: ref(4),
|
||||
handleSizeChange,
|
||||
handleCurrentChange,
|
||||
};
|
||||
},
|
||||
});
|
||||
|
||||
</setup>
|
||||
-->
|
||||
```
|
||||
:::
|
||||
|
||||
@@ -169,6 +196,21 @@ Lorsqu'il n'y a qu'une seule page, il est possible de cacher la pagination avec
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<!--
|
||||
<setup>
|
||||
|
||||
import { defineComponent, ref } from 'vue';
|
||||
|
||||
export default defineComponent({
|
||||
setup() {
|
||||
return {
|
||||
value: ref(false),
|
||||
};
|
||||
},
|
||||
});
|
||||
|
||||
</setup>
|
||||
-->
|
||||
```
|
||||
:::
|
||||
|
||||
|
||||
@@ -137,6 +137,33 @@
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<!--
|
||||
<setup>
|
||||
|
||||
import { defineComponent, ref } from 'vue';
|
||||
|
||||
export default defineComponent({
|
||||
setup() {
|
||||
const handleSizeChange = (val) => {
|
||||
console.log(`${val} items per page`);
|
||||
};
|
||||
const handleCurrentChange = (val) => {
|
||||
console.log(`current page: ${val}`);
|
||||
};
|
||||
|
||||
return {
|
||||
currentPage1: ref(5),
|
||||
currentPage2: ref(5),
|
||||
currentPage3: ref(5),
|
||||
currentPage4: ref(4),
|
||||
handleSizeChange,
|
||||
handleCurrentChange,
|
||||
};
|
||||
},
|
||||
});
|
||||
|
||||
</setup>
|
||||
-->
|
||||
```
|
||||
:::
|
||||
|
||||
@@ -165,6 +192,21 @@
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<!--
|
||||
<setup>
|
||||
|
||||
import { defineComponent, ref } from 'vue';
|
||||
|
||||
export default defineComponent({
|
||||
setup() {
|
||||
return {
|
||||
value: ref(false),
|
||||
};
|
||||
},
|
||||
});
|
||||
|
||||
</setup>
|
||||
-->
|
||||
```
|
||||
:::
|
||||
|
||||
|
||||
@@ -137,6 +137,33 @@
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<!--
|
||||
<setup>
|
||||
|
||||
import { defineComponent, ref } from 'vue';
|
||||
|
||||
export default defineComponent({
|
||||
setup() {
|
||||
const handleSizeChange = (val) => {
|
||||
console.log(`每页 ${val} 条`);
|
||||
};
|
||||
const handleCurrentChange = (val) => {
|
||||
console.log(`当前页: ${val}`);
|
||||
};
|
||||
|
||||
return {
|
||||
currentPage1: ref(5),
|
||||
currentPage2: ref(5),
|
||||
currentPage3: ref(5),
|
||||
currentPage4: ref(4),
|
||||
handleSizeChange,
|
||||
handleCurrentChange,
|
||||
};
|
||||
},
|
||||
});
|
||||
|
||||
</setup>
|
||||
-->
|
||||
```
|
||||
:::
|
||||
|
||||
@@ -165,6 +192,21 @@
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<!--
|
||||
<setup>
|
||||
|
||||
import { defineComponent, ref } from 'vue';
|
||||
|
||||
export default defineComponent({
|
||||
setup() {
|
||||
return {
|
||||
value: ref(false),
|
||||
};
|
||||
},
|
||||
});
|
||||
|
||||
</setup>
|
||||
-->
|
||||
```
|
||||
:::
|
||||
|
||||
|
||||
Reference in New Issue
Block a user