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
--PostgreSQL 13 | |
SELECT * | |
FROM shirts | |
WHERE details->'attributes'->>'color' = 'neon yellow' | |
AND details->'attributes'->>'size' = 'medium'; | |
--PostgreSQL 14 | |
SELECT * | |
FROM shirts | |
WHERE details['attributes']['color'] = '"neon yellow"' |
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 async function getStaticPaths() { | |
return { | |
paths: [ | |
{ params: { ... } } // See the "paths" section below | |
], | |
fallback: true or false // See the "fallback" section below | |
}; | |
} |
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 async function getStaticProps(context) { | |
return { | |
props: {}, // will be passed to the page component as props | |
} | |
} |
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 async function getServerSideProps(context) { | |
return { | |
props: {}, // will be passed to the page component as props | |
} | |
} |
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
-- { | |
--: { | |
"css": true, | |
"totally": { | |
"not": "controversial!" | |
} | |
} | |
} | |
#cool { |
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
# create the project | |
mkdir my-app | |
cd my-app | |
npm init svelte@next | |
# install dependencies | |
npm install | |
# start dev server and open a browser tab | |
npm run dev -- --open |
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
<!-- CustomInput.vue --> | |
<template> | |
<label> | |
{{ label }} | |
<input type="text" :name="name" :value="value" @input="onInput" @change="onChange" /> | |
</label> | |
</template> | |
<script> | |
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
<!-- CustomInput.vue --> | |
<template> | |
<label> | |
{{ label }} | |
<input type="text" :name="name" v-model="model" /> | |
</label> | |
</template> | |
<script> | |
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
<!-- CustomInput.vue --> | |
<template> | |
... | |
<input type="text" :name="name" v-model="model" /> | |
... | |
</template> | |
<script> | |
... | |
computed: { |
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
<!-- CustomInput.vue --> | |
... | |
<script> | |
... | |
watch: { | |
value: { | |
handler(value) { | |
if (value) { | |
this.error = ''; | |
} |
NewerOlder