vue 组件js化各种属性值的绑定

return createElement(
          'h' + this.level,
          [
            createElement('a', {
              attrs: {
                name: headingId,
                href: '#' + headingId
              },
              style: {
                color: 'red',
              },
              'class': {
                foo: true,
              },
              domProps: {
                innerHTML: 'baz'
              },
              props: {
                myProp: 'bar'
              },
              on: {
                click: function(event) {
                  event.preventDefault();
                  console.log(111);
                }
              }
            }, this.$slots.default)
          ]
原文地址:https://www.cnblogs.com/HePandeFeng/p/12957461.html