mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-05-30 10:19:15 +08:00
chore: prettier all codes (#10240)
This commit is contained in:
parent
8bc55c8b32
commit
969f0a7b41
@ -16,7 +16,8 @@ const DEFAULT_CONFIG = {
|
|||||||
setupFilesAfterEnv: [JEST_SETUP_FILE],
|
setupFilesAfterEnv: [JEST_SETUP_FILE],
|
||||||
moduleFileExtensions: ['js', 'jsx', 'vue', 'ts', 'tsx'],
|
moduleFileExtensions: ['js', 'jsx', 'vue', 'ts', 'tsx'],
|
||||||
transform: {
|
transform: {
|
||||||
'\\.(js|jsx|ts|tsx|vue)$': '<rootDir>/node_modules/@vant/cli/cjs/jest.transformer.cjs',
|
'\\.(js|jsx|ts|tsx|vue)$':
|
||||||
|
'<rootDir>/node_modules/@vant/cli/cjs/jest.transformer.cjs',
|
||||||
},
|
},
|
||||||
transformIgnorePatterns: ['/node_modules/(?!(@vant/cli))/'],
|
transformIgnorePatterns: ['/node_modules/(?!(@vant/cli))/'],
|
||||||
snapshotSerializers: ['jest-serializer-html'],
|
snapshotSerializers: ['jest-serializer-html'],
|
||||||
|
@ -27,12 +27,12 @@ button
|
|||||||
| transform | boolean | 防止预览区内 fixed 定位的元素飞出预览区 |
|
| transform | boolean | 防止预览区内 fixed 定位的元素飞出预览区 |
|
||||||
| inline | boolean | 只显示组件本身,不显示预览区边框和代码 |
|
| inline | boolean | 只显示组件本身,不显示预览区边框和代码 |
|
||||||
|
|
||||||
|
|
||||||
### `compact`
|
### `compact`
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<demo-code compact>./demo/MyDemo.vue</demo-code>
|
<demo-code compact>./demo/MyDemo.vue</demo-code>
|
||||||
```
|
```
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
### `transform`
|
### `transform`
|
||||||
@ -40,6 +40,7 @@ button
|
|||||||
```html
|
```html
|
||||||
<demo-code transform>./demo/MyDemo.vue</demo-code>
|
<demo-code transform>./demo/MyDemo.vue</demo-code>
|
||||||
```
|
```
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
### `inline`
|
### `inline`
|
||||||
@ -47,6 +48,7 @@ button
|
|||||||
```html
|
```html
|
||||||
<demo-code inline>./demo/MyDemo.vue</demo-code>
|
<demo-code inline>./demo/MyDemo.vue</demo-code>
|
||||||
```
|
```
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
### 去除手机模拟器
|
### 去除手机模拟器
|
||||||
@ -79,5 +81,4 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
```
|
||||||
```
|
|
||||||
|
@ -18,10 +18,9 @@
|
|||||||
<% if (baiduAnalytics) { %>
|
<% if (baiduAnalytics) { %>
|
||||||
<script>
|
<script>
|
||||||
var _hmt = _hmt || [];
|
var _hmt = _hmt || [];
|
||||||
(function() {
|
(function () {
|
||||||
var hm = document.createElement('script');
|
var hm = document.createElement('script');
|
||||||
hm.src =
|
hm.src = 'https://hm.baidu.com/hm.js?<%= baiduAnalytics.seed %>';
|
||||||
'https://hm.baidu.com/hm.js?<%= baiduAnalytics.seed %>';
|
|
||||||
var s = document.getElementsByTagName('script')[0];
|
var s = document.getElementsByTagName('script')[0];
|
||||||
s.parentNode.insertBefore(hm, s);
|
s.parentNode.insertBefore(hm, s);
|
||||||
})();
|
})();
|
||||||
|
@ -12,8 +12,7 @@
|
|||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
path:
|
path: 'M296.114 508.035c-3.22-13.597.473-28.499 11.079-39.105l333.912-333.912c16.271-16.272 42.653-16.272 58.925 0s16.272 42.654 0 58.926L395.504 498.47l304.574 304.574c16.272 16.272 16.272 42.654 0 58.926s-42.654 16.272-58.926 0L307.241 528.058a41.472 41.472 0 0 1-11.127-20.023z',
|
||||||
'M296.114 508.035c-3.22-13.597.473-28.499 11.079-39.105l333.912-333.912c16.271-16.272 42.653-16.272 58.925 0s16.272 42.654 0 58.926L395.504 498.47l304.574 304.574c16.272 16.272 16.272 42.654 0 58.926s-42.654 16.272-58.926 0L307.241 528.058a41.472 41.472 0 0 1-11.127-20.023z',
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { defineComponent } from 'vue'
|
import { defineComponent } from 'vue';
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: 'App',
|
name: 'App',
|
||||||
@ -7,6 +7,6 @@ export default defineComponent({
|
|||||||
<>
|
<>
|
||||||
<h1>App</h1>
|
<h1>App</h1>
|
||||||
</>
|
</>
|
||||||
)
|
);
|
||||||
}
|
},
|
||||||
})
|
});
|
||||||
|
@ -5,15 +5,15 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
const a = 1
|
const a = 1;
|
||||||
a = 1
|
a = 1;
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
arr: [1, 2, 3]
|
arr: [1, 2, 3],
|
||||||
}
|
};
|
||||||
}
|
},
|
||||||
}
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style></style>
|
<style></style>
|
||||||
|
@ -1,2 +1,2 @@
|
|||||||
const a = b + 1
|
const a = b + 1;
|
||||||
export default a
|
export default a;
|
||||||
|
8
packages/vant-icons/src/config.d.ts
vendored
8
packages/vant-icons/src/config.d.ts
vendored
@ -1,7 +1,7 @@
|
|||||||
declare const config: {
|
declare const config: {
|
||||||
name: string;
|
name: string;
|
||||||
basic: string[];
|
basic: string[];
|
||||||
outline: string[];
|
outline: string[];
|
||||||
filled: string[];
|
filled: string[];
|
||||||
};
|
};
|
||||||
export default config;
|
export default config;
|
||||||
|
@ -20,7 +20,7 @@ export type VueAttribute = {
|
|||||||
name: string;
|
name: string;
|
||||||
default: string;
|
default: string;
|
||||||
description: string;
|
description: string;
|
||||||
options: string[]
|
options: string[];
|
||||||
value: {
|
value: {
|
||||||
kind: 'expression';
|
kind: 'expression';
|
||||||
type: string;
|
type: string;
|
||||||
|
@ -21,8 +21,8 @@ export function normalizePath(path: string): string {
|
|||||||
return path.replace(/\\/g, '/');
|
return path.replace(/\\/g, '/');
|
||||||
}
|
}
|
||||||
|
|
||||||
// `default` `primary` -> ['default', 'primary']
|
// `default` `primary` -> ['default', 'primary']
|
||||||
export function formatOptions(options?: string) {
|
export function formatOptions(options?: string) {
|
||||||
if (!options) return []
|
if (!options) return [];
|
||||||
return options.replace(/`/g, '').split(' ')
|
return options.replace(/`/g, '').split(' ');
|
||||||
}
|
}
|
||||||
|
@ -6,9 +6,8 @@ export type CustomFieldInjectionValue = {
|
|||||||
validateWithTrigger: (trigger: 'onBlur' | 'onChange' | 'onSubmit') => void;
|
validateWithTrigger: (trigger: 'onBlur' | 'onChange' | 'onSubmit') => void;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const CUSTOM_FIELD_INJECTION_KEY: InjectionKey<CustomFieldInjectionValue> = Symbol(
|
export const CUSTOM_FIELD_INJECTION_KEY: InjectionKey<CustomFieldInjectionValue> =
|
||||||
'van-field'
|
Symbol('van-field');
|
||||||
);
|
|
||||||
|
|
||||||
export function useCustomFieldValue(customValue: () => unknown) {
|
export function useCustomFieldValue(customValue: () => unknown) {
|
||||||
const field = inject(CUSTOM_FIELD_INJECTION_KEY, null);
|
const field = inject(CUSTOM_FIELD_INJECTION_KEY, null);
|
||||||
|
@ -20,11 +20,11 @@ export default {
|
|||||||
setup() {
|
setup() {
|
||||||
const root = ref();
|
const root = ref();
|
||||||
|
|
||||||
onMounted(()=>{
|
onMounted(() => {
|
||||||
const rect = useRect(root);
|
const rect = useRect(root);
|
||||||
console.log(rect); // -> 元素的大小及其相对于视口的位置
|
console.log(rect); // -> 元素的大小及其相对于视口的位置
|
||||||
})
|
});
|
||||||
|
|
||||||
return { root };
|
return { root };
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user