<template>
    <div>
        <div class="signPop">
        <div class="signContent">
            <sign-canvas
                class="sign-canvas"
                ref="SignCanvas"
                :options="signOptions"
                v-model="signValue"
            />
        </div>
        <div class="signPopbtn">
            <van-button type="info" plain @click="clearCanvas">清除</van-button>
            <van-button type="info" @click="save">保存</van-button>
        </div>
        </div>
    </div>
</template>

<script>
export default {
    name: 'sign',
    data() {
        return {
            signOptions: {
                isSign: true,
                isShowBorder: false,
                canvasWidth: window.innerWidth,
                canvasHeight: 150,
                bgColor: '#fff'
            },
            signValue: null
        }
    },
    methods: {
        clearCanvas() {
            this.$emit('input', null)
            this.$refs.SignCanvas.canvasClear();
        },
        save() {
            this.$emit('input', this.signValue)
            this.$emit('save')
        },
    }
}
</script>
