refactor: 补充emits声明

This commit is contained in:
pipipi-pikachu 2021-08-15 00:11:25 +08:00
parent cc75249551
commit 55a7f07218
22 changed files with 23 additions and 0 deletions

View File

@ -27,6 +27,7 @@ export default defineComponent({
components: { components: {
Checkboard, Checkboard,
}, },
emits: ['colorChange'],
props: { props: {
value: { value: {
type: Object as PropType<ColorFormats.RGBA>, type: Object as PropType<ColorFormats.RGBA>,

View File

@ -34,6 +34,7 @@ const getCheckboard = (white: string, grey: string, size: number) => {
export default defineComponent({ export default defineComponent({
name: 'checkboard', name: 'checkboard',
emits: ['colorChange'],
props: { props: {
size: { size: {
type: Number, type: Number,

View File

@ -14,6 +14,7 @@ import tinycolor, { ColorFormats } from 'tinycolor2'
export default defineComponent({ export default defineComponent({
name: 'editable-input', name: 'editable-input',
emits: ['colorChange'],
props: { props: {
value: { value: {
type: Object as PropType<ColorFormats.RGBA>, type: Object as PropType<ColorFormats.RGBA>,

View File

@ -21,6 +21,7 @@ import tinycolor, { ColorFormats } from 'tinycolor2'
export default defineComponent({ export default defineComponent({
name: 'hue', name: 'hue',
emits: ['colorChange'],
props: { props: {
value: { value: {
type: Object as PropType<ColorFormats.RGBA>, type: Object as PropType<ColorFormats.RGBA>,

View File

@ -25,6 +25,7 @@ import { throttle, clamp } from 'lodash'
export default defineComponent({ export default defineComponent({
name: 'saturation', name: 'saturation',
emits: ['colorChange'],
props: { props: {
value: { value: {
type: Object as PropType<ColorFormats.RGBA>, type: Object as PropType<ColorFormats.RGBA>,

View File

@ -133,6 +133,7 @@ export default defineComponent({
Saturation, Saturation,
EditableInput, EditableInput,
}, },
emits: ['update:modelValue'],
props: { props: {
modelValue: { modelValue: {
type: String, type: String,

View File

@ -17,6 +17,7 @@ import { defineComponent, ref } from 'vue'
export default defineComponent({ export default defineComponent({
name: 'file-input', name: 'file-input',
emits: ['change'],
props: { props: {
accept: { accept: {
type: String, type: String,

View File

@ -33,6 +33,7 @@ import { useStore } from '@/store'
export default defineComponent({ export default defineComponent({
name: 'element-create-selection', name: 'element-create-selection',
emits: ['created'],
setup(props, { emit }) { setup(props, { emit }) {
const store = useStore() const store = useStore()
const ctrlOrShiftKeyActive = computed<boolean>(() => store.getters.ctrlOrShiftKeyActive) const ctrlOrShiftKeyActive = computed<boolean>(() => store.getters.ctrlOrShiftKeyActive)

View File

@ -17,6 +17,7 @@ import useLink from '@/hooks/useLink'
export default defineComponent({ export default defineComponent({
name: 'link-dialog', name: 'link-dialog',
emits: ['close'],
setup(props, { emit }) { setup(props, { emit }) {
const store = useStore() const store = useStore()
const handleElement = computed<PPTElement | null>(() => store.getters.handleElement) const handleElement = computed<PPTElement | null>(() => store.getters.handleElement)

View File

@ -15,6 +15,7 @@ import { defineComponent } from 'vue'
export default defineComponent({ export default defineComponent({
name: 'chart-pool', name: 'chart-pool',
emits: ['select'],
setup(props, { emit }) { setup(props, { emit }) {
const chartList = ['bar', 'line', 'pie'] const chartList = ['bar', 'line', 'pie']

View File

@ -59,6 +59,7 @@ import LinePointMarker from '@/views/components/element/LineElement/LinePointMar
export default defineComponent({ export default defineComponent({
name: 'line-pool', name: 'line-pool',
emits: ['select'],
components: { components: {
LinePointMarker, LinePointMarker,
}, },

View File

@ -39,6 +39,7 @@ import { SHAPE_LIST, ShapePoolItem } from '@/configs/shapes'
export default defineComponent({ export default defineComponent({
name: 'shape-pool', name: 'shape-pool',
emits: ['select'],
setup(props, { emit }) { setup(props, { emit }) {
const shapeList = SHAPE_LIST const shapeList = SHAPE_LIST

View File

@ -58,6 +58,7 @@ import { message } from 'ant-design-vue'
export default defineComponent({ export default defineComponent({
name: 'table-generator', name: 'table-generator',
emits: ['insert', 'close'],
setup(props, { emit }) { setup(props, { emit }) {
const endCell = ref<number[]>([]) const endCell = ref<number[]>([])
const customRow = ref(3) const customRow = ref(3)

View File

@ -19,6 +19,7 @@ import { Slide } from '@/types/slides'
export default defineComponent({ export default defineComponent({
name: 'remark', name: 'remark',
emits: ['update:height'],
props: { props: {
height: { height: {
type: Number, type: Number,

View File

@ -20,6 +20,7 @@ import ThumbnailSlide from '@/views/components/ThumbnailSlide/index.vue'
export default defineComponent({ export default defineComponent({
name: 'layout-pool', name: 'layout-pool',
emits: ['select'],
components: { components: {
ThumbnailSlide, ThumbnailSlide,
}, },

View File

@ -54,6 +54,7 @@ const CELL_HEIGHT = 32
export default defineComponent({ export default defineComponent({
name: 'chart-data-editor', name: 'chart-data-editor',
emits: ['save', 'close'],
props: { props: {
data: { data: {
type: Object as PropType<ChartData>, type: Object as PropType<ChartData>,

View File

@ -25,6 +25,7 @@ import ThumbnailSlide from '@/views/components/ThumbnailSlide/index.vue'
export default defineComponent({ export default defineComponent({
name: 'slide-thumbnails', name: 'slide-thumbnails',
emits: ['close'],
components: { components: {
ThumbnailSlide, ThumbnailSlide,
}, },

View File

@ -47,6 +47,7 @@ const writingBoardColors = ['#000000', '#ffffff', '#1e497b', '#4e81bb', '#e2534d
export default defineComponent({ export default defineComponent({
name: 'writing-board-tool', name: 'writing-board-tool',
emits: ['close'],
components: { components: {
WritingBoard, WritingBoard,
}, },

View File

@ -75,6 +75,7 @@ type ScaleClipRangeType = 't-l' | 't-r' | 'b-l' | 'b-r'
export default defineComponent({ export default defineComponent({
name: 'image-clip-handler', name: 'image-clip-handler',
emits: ['clip'],
props: { props: {
src: { src: {
type: String, type: String,

View File

@ -18,6 +18,8 @@ import { alignmentCommand } from '@/utils/prosemirror/commands/setTextAlign'
import { toggleList } from '@/utils/prosemirror/commands/toggleList' import { toggleList } from '@/utils/prosemirror/commands/toggleList'
export default defineComponent({ export default defineComponent({
name: 'prosemirror-editor',
emits: ['update', 'focus', 'blur'],
props: { props: {
elementId: { elementId: {
type: String, type: String,

View File

@ -16,6 +16,7 @@ import { pasteCustomClipboardString, pasteExcelClipboardString } from '@/utils/c
export default defineComponent({ export default defineComponent({
name: 'custom-textarea', name: 'custom-textarea',
emits: ['updateValue', 'insertExcelData'],
props: { props: {
value: { value: {
type: String, type: String,

View File

@ -87,6 +87,7 @@ import CustomTextarea from './CustomTextarea.vue'
export default defineComponent({ export default defineComponent({
name: 'editable-table', name: 'editable-table',
emits: ['change', 'changeColWidths', 'changeSelectedCells'],
components: { components: {
CustomTextarea, CustomTextarea,
}, },