WebApp【公共组件库】@前端(For Git Submodule)
YFeng
2024-02-28 66e98219bcac1af4d9bf684cc31af330c68b679a
forms/userSignature/CSignatureLayer.vue
@@ -73,7 +73,16 @@
        };
    },
    methods: {
        _initDraw() {
            this.canvasContext = Taro.createCanvasContext(this.cavId, this);
            const $container = $(this.$refs.drawing).parent();
            setTimeout(() => {
                $container.width().then(w => (this.cavWidth = w));
                $container.height().then(h => (this.cavHeight = h));
            }, 0);
        },
        $onDraw(callback) {
            this._initDraw();
            this.layerOpened = true;
            this._callback = callback;
            this.handleRestDraw();
@@ -420,12 +429,7 @@
    },
    mounted() {
        this.$nextTick(() => {
            this.canvasContext = Taro.createCanvasContext(this.cavId, this);
            const $container = $(this.$refs.drawing).parent();
            setTimeout(() => {
                $container.width().then(w => (this.cavWidth = w));
                $container.height().then(h => (this.cavHeight = h));
            }, 0);
            this._initDraw();
        });
    },
};