-
Notifications
You must be signed in to change notification settings - Fork 272
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP feat: support vue #628
Open
xierenyuan
wants to merge
8
commits into
master
Choose a base branch
from
feature/vue
base: master
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 5 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
0bd3ec4
chore: init directory structure
xierenyuan b46ad44
feat: add babel-preset-vue
xierenyuan 18b0d9d
feat: bundle mode support vue
xierenyuan 7168fab
chore: update pnpm-lock.yaml
xierenyuan 4735f6b
feat: support bundless vue
xierenyuan 39a0b56
feat(plugin-vue): bundless config handle
xierenyuan 45ae288
feat: refactor vue plugin
xierenyuan adda097
chore: update pnpm-lock.yaml
xierenyuan File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
dist | ||
compiled | ||
*.yaml | ||
*.yaml | ||
node_modules |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { defineConfig } from 'father'; | ||
import path from 'path'; | ||
|
||
export default defineConfig({ | ||
esm: {}, | ||
// cjs: {}, | ||
// umd: { | ||
// externals: { | ||
// vue: 'vue', | ||
// }, | ||
// }, | ||
alias: { | ||
'@': path.resolve(__dirname, './src'), | ||
}, | ||
platform: 'browser', | ||
plugins: ['@fatherjs/plugin-vue'], | ||
}); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"scripts": { | ||
"build": "rm -rf ./node_modules/.cache && father build", | ||
"build:no-clean": "father build --no-clean", | ||
"dev": "father dev", | ||
"doctor": "father doctor", | ||
"version": "father version" | ||
}, | ||
"dependencies": { | ||
"father": "workspace:*", | ||
"vue": "^3.2.47" | ||
}, | ||
"devDependencies": { | ||
"@fatherjs/plugin-vue": "workspace:*" | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import ElEmpty from './Empty.vue.b'; | ||
import type { CSSProperties, FunctionalComponent } from 'vue'; | ||
|
||
type EmptyRendererProps = { | ||
class?: JSX.IntrinsicAttributes['class']; | ||
style?: CSSProperties; | ||
}; | ||
|
||
const Footer: FunctionalComponent<EmptyRendererProps> = (props, { slots }) => { | ||
return ( | ||
<div class={props.class} style={props.style}> | ||
{slots.default ? slots.default() : <ElEmpty />} | ||
</div> | ||
); | ||
}; | ||
|
||
Footer.displayName = 'ElTableV2Empty'; | ||
|
||
export default Footer; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
class Content { | ||
say() { | ||
return 'Hello father 3'; | ||
} | ||
} | ||
|
||
export default new Content().say(); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<template> | ||
<div :class="ns.b()"> | ||
<div :class="ns.e('image')" :style="imageStyle"> | ||
<img v-if="image" :src="image" ondragstart="return false" /> | ||
<slot v-else name="image"> | ||
<img-empty /> | ||
</slot> | ||
</div> | ||
<div :class="ns.e('description')"> | ||
<slot v-if="$slots.description" name="description" /> | ||
<p v-else>{{ emptyDescription }}</p> | ||
</div> | ||
<div v-if="$slots.default" :class="ns.e('bottom')"> | ||
<slot /> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
import { computed } from 'vue'; | ||
// import { emptyProps } from './empty'; | ||
|
||
import type { CSSProperties } from 'vue'; | ||
|
||
const props = defineProps({ | ||
image: { | ||
type: String, | ||
default: '', | ||
}, | ||
imageSize: Number, | ||
description: { | ||
type: String, | ||
default: '', | ||
}, | ||
}); | ||
|
||
const emptyDescription = computed(() => props.description); | ||
const imageStyle = computed<CSSProperties>(() => ({ | ||
width: props.imageSize, | ||
})); | ||
</script> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<template> | ||
<div>{{ hello }}</div> | ||
</template> | ||
<script lang="ts" setup> | ||
import { ref } from 'vue'; | ||
|
||
const hello = ref('hello vue'); | ||
</script> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { buildProps } from '@/utils/buildProps'; | ||
import type { ExtractPropTypes } from 'vue'; | ||
|
||
export const emptyProps = buildProps({ | ||
image: { | ||
type: String, | ||
default: '', | ||
}, | ||
imageSize: Number, | ||
description: { | ||
type: String, | ||
default: '', | ||
}, | ||
} as const); | ||
|
||
export type EmptyProps = ExtractPropTypes<typeof emptyProps>; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
console.log('foo here'); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import Hello from './Hello.vue'; | ||
import Empty from './Empty.vue'; | ||
import A from '@/A'; | ||
import Content from '@/Content'; | ||
|
||
export default { | ||
Hello, | ||
Empty, | ||
A, | ||
Content, | ||
}; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export const buildProps = (props: any) => 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"compilerOptions": { | ||
"target": "ESNext", | ||
"useDefineForClassFields": true, | ||
"module": "ESNext", | ||
"moduleResolution": "Node", | ||
"strict": true, | ||
"jsx": "preserve", | ||
"resolveJsonModule": true, | ||
"isolatedModules": true, | ||
"esModuleInterop": true, | ||
"lib": ["ESNext", "DOM"], | ||
"skipLibCheck": true, | ||
"noEmit": true, | ||
"paths": { | ||
"@/*": ["./src/*"] | ||
}, | ||
"baseUrl": "." | ||
}, | ||
"include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"] | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
删了吧,引这个会有其他异常
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
是的 昨晚被坑了 1个小时
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
具体是啥问题?看 Umi 也把这个去掉了
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
无法使用 esm 的包 比如 vite 使用会有问题
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
umi 非 dev 的时候,这代码进不去
const { build } = await import("./build.js");