heatsrc / vue-declassified Goto Github PK
View Code? Open in Web Editor NEWConvert Vue Class Components to Vue 3.3 Script Setup
Home Page: https://heatsrc.github.io/vue-declassified/
License: ISC License
Convert Vue Class Components to Vue 3.3 Script Setup
Home Page: https://heatsrc.github.io/vue-declassified/
License: ISC License
When a prop is being watched using a string identifier in the watch decorator the watch is not properly converting the argument to a property access of props
.
import { Component, Vue, Prop, Emit, Watch } from 'vue-property-decorator';
@Component()
export default class Foo {
@Watch('b')
handleBPropChange(newVal: number) {
this.foo = \`\${newVal}\`;
this.bar();
});
@Prop() b: number;
}
"import { ref } from \\"vue\\";
const props = defineProps<{ "b": number; }>();
const handleBPropChange = (newVal: number) => {
foo.value = `${newVal}`;
bar();
};
watch(b, handleBPropChange);
// ^----- needs to be `props.b`
When providing the basePath
in the Vuedc Options we infer the tsconfig.json
project for better type inference (especially in regards to mixins) but we could also look for a prettier config file and use that instead of the default config used by Vuedc. I would like to keep this limited to an assumption based on this option rather than providing yet another separate option in order to keep complexity down to a "quick" vs "featureful" experience. When it comes down to it the end user can always run the output through their own projects formatter anyways.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.