This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
new Vue({ | |
el: '#app', | |
data: { | |
message: 'Hello Vue.js!' | |
} | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Vue (options) { | |
this._init(options) | |
} | |
// install internals | |
initMixin(Vue) | |
stateMixin(Vue) | |
eventsMixin(Vue) | |
lifecycleMixin(Vue) | |
miscMixin(Vue) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import initMixin from './internal/init' | |
/* ... */ | |
function Vue (options) { | |
this._init(options) | |
} | |
/* ... */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CustomHeading extends HTMLElement { | |
constructor () {} | |
} | |
customElements.define('custom-heading', CustomHeading) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Vue.component('my-component', { | |
template: '<div>A custom component!</div>' | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const customHeading = document.createElement('custom-heading') | |
document.body.appendChild(customHeading) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const elemClass = class extends HTMLElement { | |
constructor() { | |
super() | |
} | |
connectedCallback () { | |
const o = this | |
const data = o.options.data | |
Object.keys(data).forEach((key) => { | |
Object.defineProperty(o, key, { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const elemClass = class extends HTMLElement { | |
constructor() { | |
super() | |
} | |
attributeChangedCallback (name, oldValue, newValue) { | |
const o = this | |
const options = o.options | |
options.watch[name].call(o, oldValue, newValue) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const elemClass = class extends HTMLElement { | |
constructor() { | |
super() | |
} | |
static get observedAttributes () { | |
return Object.keys(this.options.data) | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function sumConsecutive (number) { | |
var arrayOfNumbers = number.split('') | |
var sum = 0 | |
var currentNumber = null | |
var nextNumber = null | |
var arrayLength = arrayOfNumbers.length | |
for (var i = arrayLength - 1; i >= 0; i--) { | |
currentNumber = arrayOfNumbers[i] |