This file contains hidden or 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 React from 'react' | |
| import history from '@/history' | |
| import make from './make' | |
| export default { | |
| /** | |
| * Only guests can enter this page | |
| */ | |
| guest: make((props) => { | |
| if (props.auth.data == null) { |
This file contains hidden or 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
| <?php | |
| class Auth { | |
| /** | |
| * Our unique session key | |
| */ | |
| protected $key = '__MY_APP_AUTH__'; | |
| /** | |
| * PDO Instance |
This file contains hidden or 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
| <template> | |
| <div :ref="(el) => this.el = el"></div> | |
| </template> |
This file contains hidden or 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
| <template> | |
| <autocomplete> | |
| <input slot-scope="props" ref="props.inputRef" @change="props.change" :value="props.value"></input> | |
| </autocomplete> | |
| </template> |
This file contains hidden or 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
| <template> | |
| <autocomplete> | |
| <autocomplete-input slot-scope="props" @input="props.onInput" :value="props.value"> | |
| </autocomplete-input> | |
| </autocomplete> | |
| </template> |
This file contains hidden or 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
| <template> | |
| <div> | |
| <slot></slot> | |
| </div> | |
| </template> | |
| <script> | |
| export default { | |
| name: 'autocomplete', | |
| provide() { |
This file contains hidden or 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 React, {Component} from 'react' | |
| class Column extends Component { | |
| state = { | |
| list: [], // Let's pretend this is filled by some AJAX request | |
| sorting: 0, | |
| sorted: [] | |
| } | |
| filter(sorting) { |
This file contains hidden or 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 React, {Component} from 'react' | |
| import SortingLayer from './SortingLayer' | |
| class Column extends Component { | |
| state = { | |
| list: [], // Let's pretend this is filled by some AJAX request | |
| sorting: 0 | |
| } | |
| render() { |
This file contains hidden or 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
| <SortingLayer list={list} sort={sort}> | |
| {(list) => ( | |
| list.map((item, i) => ( | |
| <div key={i}> | |
| {item.title} | |
| </div> | |
| )) | |
| )} | |
| </SortingLayer> |
This file contains hidden or 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 MyComponent extends React.Component { | |
| render() { | |
| const {fullName} = this.props.computed | |
| } | |
| } | |
| export default computed({ | |
| fullName(state, props) { | |
| return `${props.user.firstName} ${props.user.lastName}` | |
| } |