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
| build: { | |
| rollupOptions: { | |
| input: { | |
| main: '@/main.ts', | |
| jack: '@/jack.ts', | |
| }, | |
| }, | |
| } |
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 {defineCustomElement} from 'vue' | |
| import JackInTheBox from "@/JackInTheBox.vue"; | |
| customElements.define('jack-in-the-box', | |
| defineCustomElement(JackInTheBox, { | |
| shadowRoot: false | |
| }), | |
| ); |
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
| <script setup lang="ts"> | |
| import {ref, computed} from 'vue' | |
| const props = defineProps<{ | |
| tapCount: number | |
| message: string | |
| }>() | |
| const currentTaps = ref(0) | |
| const showMessage = computed(() => currentTaps.value >= props.tapCount) |
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
| from decimal import Decimal | |
| from django.db import models | |
| class Color(models.Model): | |
| red = models.DecimalField(blank=False, null=False, decimal_places=2, max_digits=12) | |
| green = models.DecimalField(blank=False, null=False, decimal_places=2, max_digits=12) | |
| blue = models.DecimalField(blank=False, null=False, decimal_places=2, max_digits=12) | |
| alpha = models.DecimalField(blank=False, null=False, decimal_places=2, max_digits=12, default=Decimal(1.0)) |
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
| createPersistedState({ | |
| paths: Object.entries(modules).map( | |
| ([mName , m]) => 'persistentPaths' in m | |
| ? m.persistentPaths.map(path => mName + "." + path) | |
| : [] | |
| ).flat(), | |
| }) |
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
| export default { | |
| state: {count: 0}, | |
| mutations: { | |
| increment: state => state.count++, | |
| decrement: state => state.count-- | |
| }, | |
| persistentPaths: ["count", ] | |
| } |
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
| export const createAppInEl = (options, store, selector) => { | |
| const mountEl = document.querySelector(selector); | |
| const app = createApp(options, {...mountEl.dataset}); | |
| app.use(store); | |
| // additional configurations here | |
| app.mount(selector); | |
| return app; | |
| } |
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
| const datasetDatatypePostfix = "Datatype"; | |
| const convertDatasetToTyped = (dataset) => { | |
| const keys = Object.keys(dataset); | |
| keys.forEach(function(key){ | |
| let datatypeKey = key + datasetDatatypePostfix; | |
| if (datatypeKey in dataset) { | |
| let datatype = dataset[datatypeKey]; | |
| switch (datatype) { | |
| case "String": //already string, do nothing |
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
| <div id="hello_world_b" data-msg="{{ msg1 }}"> | |
| <hello-world></hello-world> | |
| </div> |
NewerOlder