Files
zszq-trs/YLErpWeb/Views/Home/Index2.cshtml
T
2024-05-09 14:06:26 +08:00

34 lines
905 B
Plaintext

@{
ViewBag.Title = @GlobalConfig.ProjectTitle;
Layout = "~/Views/Shared/_MainLayout.cshtml";
}
<div id="divTest">
<template v-for="item in test1Proxy">
<input type="text" v-model="item.val" />
</template>
</div>
@section JS{
<script>
var vue = new Vue({
el: '#divTest',
data: {
test1: [{val:'0'}],
test1Proxy:[]
},
mounted: function () {
this.test1Proxy = this.test1.map(function (obj) {
return {
get val() {
return obj.val + '123';
},
set val(newValue) {
obj.val = newValue.substring(0, newValue.length - 3);
}
};
});
}
});
</script>
}