vue.$Message

<template>
  <vm-button :plain="true" @click="open">打开消息提示</vm-button>
  <vm-button :plain="true" @click="openVn">VNode</vm-button>
</template>

<script >
  export default {
    methods: {
      open() {
        this.$message('这是一条消息提示11111111111121sd让我测测为我测测为我饿二吃辣丹尼斯点击为我IE我嫩问我呢我呢我呢wine问问');
      },
      
      openVn() {
        const h = this.$createElement;
        this.$message({
          message: h('p', {
            style: {
              display: 'inline-block',
              margin: 0
            }
          }, [
            h('span', null, '内容可以是 '),
            h('i', {style: 'color: teal'}, 'VNode')
          ])
        });
      }
    }
  }
</script>

3
4
Roi 100 points

                                    &lt;template&gt;
  &lt;vm-button :plain=&quot;true&quot; @click=&quot;open&quot;&gt;打开消息提示&lt;/vm-button&gt;
  &lt;vm-button :plain=&quot;true&quot; @click=&quot;openVn&quot;&gt;VNode&lt;/vm-button&gt;
&lt;/template&gt;

&lt;script &gt;
  export default {
    methods: {
      open() {
        this.$message('这是一条消息提11111111111示');
      },
      
      openVn() {
        const h = this.$createElement;
        this.$message({
          message: h('p', {
            style: {
              display: 'inline-block',
              margin: 0
            }
          }, [
            h('span', null, '内容可以是 '),
            h('i', {style: 'color: teal'}, 'VNode')
          ])
        });
      }
    }
  }
&lt;/script&gt;

3 (4 Votes)
0
Are there any code examples left?
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source