Skip to content

Instantly share code, notes, and snippets.

<greeting :name="Kwoosh"></greeting>
@jacobwyke
jacobwyke / prop-example.js
Created January 9, 2018 12:34
Vue.js component with render function template with props
Vue.component('greeting', {
//Renders:
//<p>Hello <name></p>
render(createElement) {
return createElement(
'p',
'Hello '+this.name
);
},
prop: ['name']
<div>
<h1>Hello World!</h1>
<p>Welcome to Vue.js</p>
<p>A <a href="foo/bar.html">link</a> within a sentence.</p>
</div>
@jacobwyke
jacobwyke / multiple-nodes-vuejs-component.js
Created January 9, 2018 12:32
Vue.js render function template component with multiple child nodes
Vue.component('greeting', {
//Renders:
//<div>
// <h1>Hello World!</h1>
// <p>Welcome to Vue.js</p>
// <p>A <a href="foo/bar.html">link</a> within a sentence.</p>
//</div>
render(createElement) {
return createElement(
'div',
@jacobwyke
jacobwyke / greeting-component.js
Created January 9, 2018 12:28
Simple vue.js rendered template component
Vue.component('greeting', {
//Renders:
//<p>Hello World</p>
render(createElement) {
return createElement(
'p',
'Hello World'
);
}
});
<greeting></greeting>
<div id="my-div" data-foo="bar" class="foo bar" style="width: 150px;">
<h1>Hello World!</h1>
<p>Welcome to Vue.js</p>
<p>A <a href="foo/bar.html">link</a> within a sentence.</p>
</div>
@jacobwyke
jacobwyke / vue-js-create-element.js
Created January 9, 2018 12:19
Here is a basic outline of the arguments the createElement function accepts and how to use them.
createElement (
// {String | Object | Function}
// Element tag name, component options, or function
// returning one of these.
// Required.
'div',
// {Object}
// Object corresponding to the components attributes
// Optional.
@jacobwyke
jacobwyke / build.xml
Created November 6, 2017 17:39
Ant build commands to breakdown tox tests into different components
<exec dir="${basedir}/src/" executable="/usr/bin/tox" failonerror="true">
<arg line="-e py35 -- tests/unit --cov=./ --cov-report=xml --junitxml=junit-unit.xml --cov-append"/>
</exec>
<exec dir="${basedir}/src/" executable="/usr/bin/tox" failonerror="true">
<arg line="-e py35 -- tests/functional --cov=./ --cov-report=xml --junitxml=junit-unit.xml --cov-append"/>
</exec>