日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 >

[vue-element] 你有二次封装过ElementUI组件吗?

發布時間:2023/12/9 41 豆豆
生活随笔 收集整理的這篇文章主要介紹了 [vue-element] 你有二次封装过ElementUI组件吗? 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

[vue-element] 你有二次封裝過ElementUI組件嗎?

popover + button 的組件,點擊該按鈕后還有個二次確認或選擇的交互。
InfiniteScroll 封裝個簡單的帶觸底加載的列表

<template><el-inputplaceholder="價格"v-model="current":disabled="disabled":maxlength="8"@change="change"></el-input> </template> <script> export default {props: {value: Number,disabled: Boolean},data() {return {current: ""};},watch: {value(val) {if (val > 0) {this.current = (val / 100).toFixed(2);} else {this.current = "";}}},created() {if (this.value > 0) {this.current = (this.value / 100).toFixed(2);} else {this.current = "";}},methods: {change() {let value = this.current * 100 || 0;this.current = (value / 100).toFixed(2);this.$emit("input", value.toFixed(0) * 1);}} }; </script>

個人簡介

我是歌謠,歡迎和大家一起交流前后端知識。放棄很容易,
但堅持一定很酷。歡迎大家一起討論

主目錄

與歌謠一起通關前端面試題

總結

以上是生活随笔為你收集整理的[vue-element] 你有二次封装过ElementUI组件吗?的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。