|
@@ -105,30 +105,30 @@ const myNewComponentTypes = (editor) => {
|
|
|
// });
|
|
|
|
|
|
//图片属性
|
|
|
- editor.Components.addType('img', {
|
|
|
- isComponent: (el) => el.tagName === 'IMG',
|
|
|
- model: {
|
|
|
- defaults: {
|
|
|
- traits: [
|
|
|
- {
|
|
|
- type: 'text', // Type of the trait
|
|
|
- name: 'title', // (required) The name of the attribute/property to use on component
|
|
|
- label: 'title', // The label you will see in Settings
|
|
|
- },
|
|
|
- {
|
|
|
- type: 'text', // Type of the trait
|
|
|
- name: 'width', // (required) The name of the attribute/property to use on component
|
|
|
- label: 'width', // The label you will see in Settings
|
|
|
- },
|
|
|
- {
|
|
|
- type: 'text', // Type of the trait
|
|
|
- name: 'height', // (required) The name of the attribute/property to use on component
|
|
|
- label: 'height', // The label you will see in Settings
|
|
|
- },
|
|
|
- ],
|
|
|
- },
|
|
|
- },
|
|
|
- });
|
|
|
+ // editor.Components.addType('img', {
|
|
|
+ // isComponent: (el) => el.tagName === 'IMG',
|
|
|
+ // model: {
|
|
|
+ // defaults: {
|
|
|
+ // traits: [
|
|
|
+ // {
|
|
|
+ // type: 'text', // Type of the trait
|
|
|
+ // name: 'title', // (required) The name of the attribute/property to use on component
|
|
|
+ // label: 'title', // The label you will see in Settings
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // type: 'text', // Type of the trait
|
|
|
+ // name: 'width', // (required) The name of the attribute/property to use on component
|
|
|
+ // label: 'width', // The label you will see in Settings
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // type: 'text', // Type of the trait
|
|
|
+ // name: 'height', // (required) The name of the attribute/property to use on component
|
|
|
+ // label: 'height', // The label you will see in Settings
|
|
|
+ // },
|
|
|
+ // ],
|
|
|
+ // },
|
|
|
+ // },
|
|
|
+ // });
|
|
|
};
|
|
|
const csrfToken = document.querySelector('meta[name="csrf-token"]').getAttribute('content');
|
|
|
// 创建 GrapesJS 编辑器实例
|