VUE 中使用LODOP 打印设计、生成代码预览
打印设计、生成代码预览
<template>
<div class = "container alone">
<div>
<textarea v-model = "s1" rows = "12" cols = "107"></textarea>
</div>
<div>
<el-button size = "small" type = "primary" @click = "prn1_design">打印设计</el-button>
<el-button size = "small" type = "primary" @click = "prn2_Preview">用设计生成代码预览</el-button>
</div>
</div>
</template>
<script>
import {getLodop} from '../../tools/LodopFuncs'
let LODOP;
export default {
name: "lodopDesign",
data() {
return {
s1: '',
}
},
methods: {
prn1_design() {
let thas = this;
LODOP = getLodop();
if (LODOP.CVERSION) CLODOP.On_Return = function (TaskID, Value) {
thas.s1 = Value;
};
thas.s1 = LODOP.PRINT_DESIGN();
},
prn2_Preview() {
LODOP = getLodop();
eval(this.s1);
if (LODOP.CVERSION) CLODOP.On_Return = null;
LODOP.PREVIEW();
}
}
}
</script>
<style scoped>
</style>
变量转换
在这里插入代码片