@huyuchen/visual
Version:
## 组件环境
49 lines (48 loc) • 1.2 kB
JavaScript
import { openBlock as s, createElementBlock as n } from "vue";
import "./HuNumberRoll.vue2.js";
import a from "../_virtual/_plugin-vue_export-helper.js";
const c = {
name: "HuNumberRoll",
props: {
value: {
type: String,
default: "0"
},
color: {
type: String,
default: "#000"
}
},
watch: {
value(t, o) {
const e = this.$refs.numberRoll;
this.createDiv("tope"), setTimeout(() => {
const l = Array.from(e.getElementsByClassName("topq"))[0], r = Array.from(e.getElementsByClassName("tope"))[0];
l.className = "topw", r.className = "topq", setTimeout(() => {
e.removeChild(l);
}, 900);
}, 50);
}
},
mounted() {
this.$nextTick(() => {
this.createDiv("topq");
});
},
methods: {
createDiv(t) {
const o = this.$refs.numberRoll, e = document.createElement("div");
e.style.color = this.color, e.innerHTML = this.value, e.className = t, o.appendChild(e);
}
}
}, m = {
class: "number-roll",
ref: "numberRoll"
};
function i(t, o, e, l, r, p) {
return s(), n("div", m, null, 512);
}
const h = /* @__PURE__ */ a(c, [["render", i]]);
export {
h as default
};