mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
fix(Image): loading placeholder not work
This commit is contained in:
parent
eb0cc05b12
commit
c720eea831
@ -48,7 +48,7 @@ export default createComponent({
|
||||
emits: ['change', 'confirm'],
|
||||
|
||||
setup(props, { emit, slots }) {
|
||||
const pickerRef = ref(null);
|
||||
const pickerRef = ref();
|
||||
|
||||
const state = reactive({
|
||||
code: props.value,
|
||||
|
@ -46,8 +46,8 @@ export default createComponent({
|
||||
|
||||
setup(props, { emit }) {
|
||||
const [visible, setVisible] = useToggle();
|
||||
const daysRef = ref(null);
|
||||
const monthRef = ref(null);
|
||||
const daysRef = ref();
|
||||
const monthRef = ref();
|
||||
|
||||
const title = computed(() => formatMonthTitle(props.date));
|
||||
|
||||
|
@ -27,8 +27,8 @@ export default createComponent({
|
||||
},
|
||||
|
||||
setup(props, { slots }) {
|
||||
const wrapperRef = ref(null);
|
||||
const contentRef = ref(null);
|
||||
const wrapperRef = ref();
|
||||
const contentRef = ref();
|
||||
const { parent, index } = useParent(COLLAPSE_KEY);
|
||||
|
||||
const currentName = computed(() =>
|
||||
|
@ -37,7 +37,7 @@ export default createComponent({
|
||||
setup(props, { emit, slots }) {
|
||||
const error = ref(false);
|
||||
const loading = ref(true);
|
||||
const imageRef = ref(null);
|
||||
const imageRef = ref();
|
||||
|
||||
const style = computed(() => {
|
||||
const style = {};
|
||||
@ -94,11 +94,10 @@ export default createComponent({
|
||||
};
|
||||
|
||||
const renderPlaceholder = () => {
|
||||
if (props.loading && props.showLoading) {
|
||||
if (loading.value && props.showLoading) {
|
||||
return <div class={bem('loading')}>{renderLoadingIcon()}</div>;
|
||||
}
|
||||
|
||||
if (props.error && props.showError) {
|
||||
if (error.value && props.showError) {
|
||||
return <div class={bem('error')}>{renderErrorIcon()}</div>;
|
||||
}
|
||||
};
|
||||
|
@ -30,8 +30,8 @@ export default createComponent({
|
||||
emits: ['click-left', 'click-right'],
|
||||
|
||||
setup(props, { emit, slots }) {
|
||||
const height = ref(null);
|
||||
const navBarRef = ref(null);
|
||||
const height = ref();
|
||||
const navBarRef = ref();
|
||||
|
||||
onMounted(() => {
|
||||
if (props.placeholder && props.fixed) {
|
||||
|
@ -24,12 +24,12 @@ export default createComponent({
|
||||
},
|
||||
|
||||
setup(props) {
|
||||
const rootRef = ref(null);
|
||||
const pivotRef = ref(null);
|
||||
const rootRef = ref();
|
||||
const pivotRef = ref();
|
||||
|
||||
const state = reactive({
|
||||
pivotWidth: 0,
|
||||
rootWidth: 0,
|
||||
pivotWidth: 0,
|
||||
});
|
||||
|
||||
const background = computed(() =>
|
||||
@ -38,8 +38,8 @@ export default createComponent({
|
||||
|
||||
const setWidth = () => {
|
||||
nextTick(() => {
|
||||
state.pivotWidth = pivotRef.value ? pivotRef.value.offsetWidth : 0;
|
||||
state.rootWidth = rootRef.value.offsetWidth;
|
||||
state.pivotWidth = pivotRef.value ? pivotRef.value.offsetWidth : 0;
|
||||
});
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user