vue render function
vue render function
https://vuejs.org/v2/guide/render-function.html
{
// Same API as `v-bind:class`, accepting either
// a string, object, or array of strings and objects.
class: {
foo: true,
bar: false
},
// Same API as `v-bind:style`, accepting either
// a string, object, or array of objects.
style: {
color: 'red',
fontSize: '14px'
},
// Normal HTML attributes
attrs: {
id: 'foo'
},
// Component props
props: {
myProp: 'bar'
},
// DOM properties
domProps: {
innerHTML: 'baz'
},
// Event handlers are nested under `on`, though
// modifiers such as in `v-on:keyup.enter` are not
// supported. You'll have to manually check the
// keyCode in the handler instead.
on: {
click: this.clickHandler
},
// For components only. Allows you to listen to
// native events, rather than events emitted from
// the component using `vm.$emit`.
nativeOn: {
click: this.nativeClickHandler
},
// Custom directives. Note that the `binding`'s
// `oldValue` cannot be set, as Vue keeps track
// of it for you.
directives: [
{
name: 'my-custom-directive',
value: '2',
expression: '1 + 1',
arg: 'foo',
modifiers: {
bar: true
}
}
],
// Scoped slots in the form of
// { name: props => VNode | Array<VNode> }
scopedSlots: {
default: props => createElement('span', props.text)
},
// The name of the slot, if this component is the
// child of another component
slot: 'name-of-slot',
// Other special top-level properties
key: 'myKey',
ref: 'myRef',
// If you are applying the same ref name to multiple
// elements in the render function. This will make `$refs.myRef` become an
// array
refInFor: true
}
attrs


https://css-tricks.com/what-does-the-h-stand-for-in-vues-render-method/
https://alligator.io/vuejs/introduction-render-functions/
macOS & bash shell
bash !== node





Windows
#!/usr/bin/env node
echo "^-v-^ app is running in development env!" && npm run start
MacOS
#!/usr/bin/env bash
echo "^-v-^ app is running in development env!" && npm run start
# chmod +x
$ chmod +x ./app.sh & sudo npm link & "app": "app.sh"
# npm link
$ npm link
vue render function的更多相关文章
- vue render function & dataset
vue render function & dataset https://vuejs.org/v2/guide/render-function.html#The-Data-Object-In ...
- template or render function not defined vue 突然报错了,怎么解决
报错图例如下:template or render function not defined vue 突然报错了,怎么解决什么错误呢,就是加载不出来,网上看了一通,是vue版本不对,是vue-comp ...
- [Vue warn]: Error in render: "TypeError: Cannot read property '0' of undefined、vuejs路由使用的问题Error in render function
1.[Vue warn]: Error in render: "TypeError: Cannot read property '0' of undefined 注意,只要出现Error i ...
- "[Vue warn]: Failed to mount component: template or render function not defined"错误的解决
VUE中动态路由出错: vue.esm.js?a026: [Vue warn]: Failed to mount component: template or render function not ...
- vue h render function & render select with options bug
vue h render function & render select with options bug https://github.com/xgqfrms/vue/issues/41 ...
- [Vue @Component] Control Template Contents with Vue's Render Function
Declaring templates and elements inside of templates works great for most scenarios. Sometimes you n ...
- [Vue warn]: You may have an infinite update loop in a component render function
[Vue warn]: You may have an infinite update loop in a component render function 这个问题很奇怪,之前从来没有遇到过.如果 ...
- vue render里面的nativeOn
vue render里面的nativeOn的解释官方的解释是:// 仅对于组件,用于监听原生事件,而不是组件内部使用 `vm.$emit` 触发的事件. 官方的解释比较抽象 个人理解: 父组件要在子组 ...
- vue render函数 函数组件化
之前创建的锚点标题组件是比较简单,没有管理或者监听任何传递给他的状态,也没有生命周期方法,它只是一个接受参数的函数 在这个例子中,我们标记组件为functional,这意味它是无状态(没有data), ...
随机推荐
- C语言第三周
一. 字符串常量 只要有一对双引号括起来的字符序列就是字符串常量.列如"hello"接"123" 注意:"a"是字符串常量'a'是字符常量. ...
- 20155327《Java程序设计》第二周学习总结
<Java程序设计>第二学习总结 教材学习内容总结 类型 byte(字节) shot(短整型) int(整型) long(长整型) float(浮点型) double(双精度) char( ...
- MySQLdb in Python: “Can't connect to MySQL server on 'localhost'”
因为我使用的是win64,所以在此系统下,需要设置为 127.0.0.1 #coding=utf-8 import MySQLdb if __name__ == '__main__': # 打开数据库 ...
- JS基础,课堂作业,健康体重评估
健康体重评估 <script> var sex = prompt("请输入性别:"); var height = parseInt(prompt("请输入身高 ...
- 我们一起学习WCF 第三篇头消息验证用户身份
前言:今天我主要写的是关于头消息的一个用处验证用户信息 下面我画一个图,可以先看图 第一步:我们先开始做用户请求代码 首先:创建一个可执行的上下文对象块并定义内部传输的通道 using (Operat ...
- 打造linux下的source insight——vim插件安装使用总结
source insight是windows下的优秀编辑器,适合阅读管理代码,主要有以下功能: 查找函数,变量或者宏的定义. 查找函数,变量或者宏的引用位置. 查找函数被调用的位置 查找某个符号在工程 ...
- grep 文件内容搜索
比如现在我们要查找在/home/userlan/目录中哪些文件中包含foobar这个关键字 1. 打开终端2. 输入命令 grep -rl "foobar" /home/userl ...
- 第四篇 前端学习之JQuery基础
一 jQuery是什么? jQuery就是一个JavaScript的库. <1> jQuery由美国人John Resig创建,至今已吸引了来自世界各地的众多 javascript高手加入 ...
- 你的第一个接口测试:Python 接口测试
前言: 首先我们先明确一个概念,什么叫接口.什么叫接口测试? 接口的全称叫[Application Programming Interface 又叫API],是提供应用程序与开发人员基于某软件或硬件得 ...
- flexbox的应用
2009年,display: box 就已经出现,但是直到IE11的发布,全部的主流浏览器才统一支持新的用法display: flex. 这里只说应用,浏览器的兼容处理会附在文章的末尾. 起步 在现代 ...