mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-13 20:00:25 +08:00
优化代码
This commit is contained in:
@@ -1,7 +1,12 @@
|
||||
Vue.component("size-capacity-view", {
|
||||
props:["v-default-text", "v-value"],
|
||||
methods: {
|
||||
composeCapacity: function (capacity) {
|
||||
return teaweb.convertSizeCapacityToString(capacity)
|
||||
}
|
||||
},
|
||||
template: `<div>
|
||||
<span v-if="vValue != null && vValue.count > 0">{{vValue.count}}{{vValue.unit.toUpperCase().replace(/(.)B/, "$1iB")}}</span>
|
||||
<span v-if="vValue != null && vValue.count > 0">{{composeCapacity(vValue)}}</span>
|
||||
<span v-else>{{vDefaultText}}</span>
|
||||
</div>`
|
||||
})
|
||||
Reference in New Issue
Block a user