<Route path='/login'>
Login Page
</Route>
<Route path='/user/:id'>
<template #default="props">
User Page
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
<script> | |
export default { | |
methods: { | |
fetch() { | |
//... | |
} | |
} | |
} | |
export default { |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>TODO app</title> | |
</head> | |
<body> | |
<div id="app1"> | |
loading... |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Javascript tool to convert BSON binary file into JSON</title> | |
<style> | |
html, body { | |
/* margin: 0; */ | |
/* padding: 0; */ |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Docs</title> | |
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/swagger-ui.css"> | |
</head> | |
<body> | |
<div id="ui-wrapper-new" data-spec="{{spec}}"> |
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
module.exports = { | |
env: { | |
browser: true, | |
node: true | |
}, | |
parserOptions: { | |
sourceType: 'module', | |
ecmaVersion: 2020 | |
}, | |
rules: { |
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
export const get = (name = '') => { | |
const storage = localStorage.getItem(name) | |
const resp = JSON.parse(storage) | |
return Array.isArray(resp) ? resp : [] | |
} | |
export const save = (name = '', obj) => { | |
localStorage.setItem(name, JSON.stringify(obj)) | |
} |
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
<!DOCTYPE html> | |
<html> | |
<body> | |
<div id="app"> | |
<h1>Hello World!</h1> | |
</div> | |
<script type="module"> | |
import Vue from 'https://cdn.jsdelivr.net/npm/[email protected]/dist/vue.esm.browser.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
<!DOCTYPE html> | |
<html> | |
<script src="https://unpkg.com/react@16/umd/react.production.min.js"></script> | |
<script src="https://unpkg.com/react-dom@16/umd/react-dom.production.min.js"></script> | |
<script src="https://unpkg.com/[email protected]/babel.min.js"></script> | |
<body> | |
<div id="app"></div> | |
<script type="text/babel"> |
One thing I quite like from the Nuxt framework is the automatic routing capabilities. After a quick look on the web I came across https://github.com/ktsn/vue-auto-routing and a great tutorial from Michal https://codeburst.io/automatic-routing-in-vue-js-applications-1403ba425bfa. I tried to implement this plugin but it felt it could be done even more simple with the use of require.context.
It turns this folder structure:
pages
|- dashboard
|- photos
|- users
NewerOlder