【问题标题】:How to change style of tiptap-vuetify如何改变tiptap-vuetify的风格
【发布时间】:2021-08-30 04:44:52
【问题描述】:

我正在使用tiptap-vuetify(https://github.com/iliyaZelenko/tiptap-vuetify) 作为我所见即所得的编辑器。但我不想要默认样式。唱它不把类或风格作为道具我怎么能按照我想要的方式来设计它(比如去除阴影,把灰色变成白色等)

【问题讨论】:

    标签: css vue.js vuetify.js wysiwyg tiptap


    【解决方案1】:

    你需要导入自定义扩展,我搜索一下 在这个包中tiptap-vuetify你只能使用这个包中的有限部分,例如:

       Heading,
       Bold,
       Italic,
       Strike,
       Underline,
       Code,
       CodeBlock,
       Paragraph,
       BulletList,
       OrderedList,
       ListItem,
       Blockquote,
       HardBreak,
       HorizontalRule,
       History,
       Link
    

    这段代码可以帮助你:

    <template>
      <div>
        <tiptap-vuetify v-model="content" :extensions="extensions" />
      </div>
    </template>
    
    
    
    
    
    <script>
    import {
      // component
      TiptapVuetify,
      Underline,
      Bold,
      Italic,
      Link,
      Paragraph,
      BulletList,
      ListItem,
      History,
    } from "tiptap-vuetify";
    
    export default {
      components: { TiptapVuetify },
      created() {
        this.$vuetify.rtl = false;
      },
      data: () => ({
        extensions: [
          new Bold(),
          new Italic(),
          new Underline(),
          // new Code(),
          // new CodeBlock(),
          new Paragraph(),
          new BulletList(),
          // new OrderedList(),
          new ListItem(),
          new Link(),
          // new Blockquote(),
          // new HardBreak(), // Shift + Enter
          // new HorizontalRule(),
          new History(),
        ],
        content: `
    <h1>Most basic use</h1>
    <p>
      You can use the necessary Extensions. 
      The corresponding buttons are 
      <strong>
        added automatically
      </strong>.
    </p>
    <pre><code>&lt;tiptap-vuetify v-model="content" :extensions="extensions"/&gt;</code></pre>
    <p></p>
    <h2>Icons</h2>
    <p>Avaliable icons groups:</p>
    <ol>
      <li>
        <p>Material Design <em>Official</em></p>
      </li>
      <li>
        <p>Font Awesome (FA)</p>
      </li>
      <li>
        <p>Material Design Icons (MDI)</p>
      </li>
    </ol>
    <p></p>
    <blockquote>
      <p>This package is awesome!</p>
    </blockquote>
    <p></p>
        `,
      }),
    };
    </script>
    

    这个link可以帮助你

    【讨论】:

      猜你喜欢
      • 2018-04-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-10-30
      • 2019-05-08
      • 1970-01-01
      • 2012-08-11
      • 1970-01-01
      相关资源
      最近更新 更多