Skip to content

Commit 1c3ff75

Browse files
committed
fix: 修复Resolver引入方式异常
1 parent 33cd64a commit 1c3ff75

File tree

5 files changed

+14
-10
lines changed

5 files changed

+14
-10
lines changed

components/button/button.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,6 @@ export default defineComponent({
2525
</button>
2626
</template>
2727

28-
<style lang="scss"></style>
28+
<style lang="scss">
29+
@import "./index";
30+
</style>

components/button/index.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.up-btn {
2+
}

dist/index.cjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ function UpResolver() {
2525
type: "component",
2626
resolve: (name) => {
2727
if (/^(Up[A-Z]|up-[a-z])/.test(name)) {
28-
const cName = name.slice(3).replace(/([a-z])/, "$1").toLowerCase();
29-
const component = `up-uniapp/components/${cName}/${cName}.vue`;
30-
const style = `up-uniapp/components/${cName}/index.scss`;
28+
const cName = name.slice(2).replace(/([a-z])/, "$1").toLowerCase();
29+
const component = `uni-ui-plus/components/${cName}/${cName}.vue`;
30+
const style = `uni-ui-plus/components/${cName}/index.scss`;
3131
return {
3232
name,
3333
from: component,

dist/index.mjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ function UpResolver() {
99
type: "component",
1010
resolve: (name) => {
1111
if (/^(Up[A-Z]|up-[a-z])/.test(name)) {
12-
const cName = name.slice(3).replace(/([a-z])/, "$1").toLowerCase();
13-
const component = `up-uniapp/components/${cName}/${cName}.vue`;
14-
const style = `up-uniapp/components/${cName}/index.scss`;
12+
const cName = name.slice(2).replace(/([a-z])/, "$1").toLowerCase();
13+
const component = `uni-ui-plus/components/${cName}/${cName}.vue`;
14+
const style = `uni-ui-plus/components/${cName}/index.scss`;
1515
return {
1616
name,
1717
from: component,

src/resolver/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ export function UpResolver(): ComponentResolver {
3030
resolve: (name: string) => {
3131
if (/^(Up[A-Z]|up-[a-z])/.test(name)) {
3232
const cName = name
33-
.slice(3)
33+
.slice(2)
3434
.replace(/([a-z])/, "$1")
3535
.toLowerCase();
36-
const component = `up-uniapp/components/${cName}/${cName}.vue`;
37-
const style = `up-uniapp/components/${cName}/index.scss`;
36+
const component = `uni-ui-plus/components/${cName}/${cName}.vue`;
37+
const style = `uni-ui-plus/components/${cName}/index.scss`;
3838

3939
return {
4040
name,

0 commit comments

Comments
 (0)