Если:
. Затем ALTER TABLE tbl_name DISABLE KEYS
может значительно улучшить скорость ваших вставок. Когда вы закончите, запустите ALTER TABLE tbl_name ENABLE KEYS
, чтобы начать создавать индексы, что может занять некоторое время, но не так долго, как делать это для каждой вставки.
Вам необходимо использовать vue.js
вычисленные свойства
new Vue({
name: 'Problem',
data: function () {
return {
num: math.randomInt(1,35)
}
},
watch: {
num: function () {
console.log("Data changed");
this.renderMath();
}
},
computed: {
square: function () {
return this.num**2;
}
},
created: function () {
console.log("Hello This is created!");
this.renderMath();
},
beforeMount: function () {
console.log("This is beforeMount");
},
mounted: function () {
console.log("This is mounted!");
},
beforeUpdate: function () {
console.log("This is beforeUpdate");
//this.renderMath();
},
methods: {
addOne: function() {
this.num++
},
randomInt: function () {
this.num = math.randomInt(1,35)
},
renderMath: function (event) {
this.$nextTick(function(){
MathLive.renderMathInElement("math");
})
}
}
}).$mount("#app")
<script src="https://unpkg.com/mathjs/dist/math.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/mathlive@0.26.0/dist/mathlive.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.17/vue.js"></script>
<div id="app">
<span>${{num}}^2 = {{square}}$</span>
<span id="math"></span>
<button @click="addOne">Add One</button>
<button @click="randomInt">Random Number</button>
</div>