diff --git a/examples/App.vue b/examples/App.vue index 96e28a8..c69a6bb 100644 --- a/examples/App.vue +++ b/examples/App.vue @@ -35,9 +35,9 @@ export default { name: 'App', data(){ return { - initFileName: '测试.pdf', + initFileName: 'test.pdf', initFile :'', - textFields: ['初始文本'], + textFields: ['initial text'], imageUrls: [], } }, diff --git a/examples/main.js b/examples/main.js index bb20331..dab09b8 100644 --- a/examples/main.js +++ b/examples/main.js @@ -1,9 +1,9 @@ import Vue from 'vue' import App from './App.vue' -// 导入组件库 +// Import component library import VuePdfEditor from './../packages/index' -// 注册组件库 +// Registered component library Vue.use(VuePdfEditor) Vue.config.productionTip = false diff --git a/packages/index.js b/packages/index.js index 405b62b..3efdac6 100644 --- a/packages/index.js +++ b/packages/index.js @@ -1,27 +1,28 @@ -// 导入颜色选择器组件 +// Import color picker component import VuePdfEditor from './vue-pdf-editor' -// 存储组件列表 +// Store component list const components = [ VuePdfEditor ] -// 定义 install 方法,接收 Vue 作为参数。如果使用 use 注册插件,则所有的组件都将被注册 +// Define the install method, receiving Vue as a parameter. If you use use +// to register a plugin, all components will be registered const install = function (Vue) { - // 判断是否安装 + // Determine whether to install if (install.installed) return - // 遍历注册全局组件 + // Traverse registered global components components.map(component => Vue.component(component.name, component)) } -// 判断是否是直接引入文件 +// Determine whether the file is imported directly if (typeof window !== 'undefined' && window.Vue) { install(window.Vue) } export default { - // 导出的对象必须具有 install,才能被 Vue.use() 方法安装 + // Exported objects must have install before they can be installed by the Vue.use() method install, - // 以下是具体的组件列表 + // The following is a specific list of components VuePdfEditor } diff --git a/packages/vue-pdf-editor/index.js b/packages/vue-pdf-editor/index.js index d87e6c4..631b14d 100644 --- a/packages/vue-pdf-editor/index.js +++ b/packages/vue-pdf-editor/index.js @@ -1,12 +1,12 @@ -// 导入组件,组件必须声明 name +// To import components, components must declare name import VuePdfEditor from './src/VuePdfEditor.vue' import './style/main.css' -// 为组件提供 install 安装方法,供按需引入 +// Provide an INSTALL installation method for the component to introduce it on demand VuePdfEditor.install = function (Vue) { Vue.component(VuePdfEditor.name, VuePdfEditor) } -// 默认导出组件 +// Default export component export default VuePdfEditor diff --git a/packages/vue-pdf-editor/src/DrawingCanvas.vue b/packages/vue-pdf-editor/src/DrawingCanvas.vue index dfe7dcb..a66f04e 100644 --- a/packages/vue-pdf-editor/src/DrawingCanvas.vue +++ b/packages/vue-pdf-editor/src/DrawingCanvas.vue @@ -32,7 +32,7 @@ " @click="onClose" > - 取消 + Cancel diff --git a/packages/vue-pdf-editor/src/PDFPage.vue b/packages/vue-pdf-editor/src/PDFPage.vue index dcebd64..577f024 100644 --- a/packages/vue-pdf-editor/src/PDFPage.vue +++ b/packages/vue-pdf-editor/src/PDFPage.vue @@ -28,7 +28,7 @@ export default { }, watch: { scale(newScale) { - this.dynamicScale = newScale; // 监听scale属性的变化,并更新动态缩放 + this.dynamicScale = newScale; // Monitor changes in the scale attribute and update dynamic scaling this.render(); }, }, diff --git a/packages/vue-pdf-editor/src/TextItem.vue b/packages/vue-pdf-editor/src/TextItem.vue index a946edd..ec07a39 100644 --- a/packages/vue-pdf-editor/src/TextItem.vue +++ b/packages/vue-pdf-editor/src/TextItem.vue @@ -22,7 +22,7 @@ @tapout="onBlurTool" >