trydofor / professional-razor

Use front-end tech (Vue/Css/Ts) to build multi-platform from one codebase, suitable for small team and app to write logic once, run anywhere.
Apache License 2.0
1 stars 0 forks source link

ionic slot is not vue slot #43

Closed trydofor closed 1 month ago

trydofor commented 1 month ago
<IonTabBar slot="bottom">
  <IonTabButton
    v-for="tb in tabs"
    :key="tb.tab"
    :tab="tb.tab"
    :href="tb.href"
  >
    <div :class="tb.icon" />
    <IonLabel>{{ tb.label }}</IonLabel>
  </IonTabButton>
</IonTabBar>

will lint to

<template #bottom>
  <IonTabBar>
    <IonTabButton
      v-for="tb in tabs"
      :key="tb.tab"
      :tab="tb.tab"
      :href="tb.href"
    >
      <div :class="tb.icon" />
      <IonLabel>{{ tb.label }}</IonLabel>
    </IonTabButton>
  </IonTabBar>
</template>

to lead ionic IonTabBar works wrong

trydofor commented 1 month ago

https://eslint.vuejs.org/rules/no-deprecated-slot-attribute.html

"ignore" (string[]) An array of tags that ignore this rules. This option will check both kebab-case and PascalCase versions of the given tag names. Default is empty.

disable by component

{
  files: ['**/*.vue'],
  rules: {
    'vue/no-deprecated-slot-attribute': ['error', {
      ignore: ['IonTabBar'],
    }],
  },
},

disable line

<!-- eslint-disable-next-line vue/no-deprecated-slot-attribute -->
<IonTabBar slot="bottom">

disable block

<!-- eslint-disable vue/no-deprecated-slot-attribute -->
<IonTabBar slot="bottom">
  <!-- eslint-enable vue/no-deprecated-slot-attribute -->
trydofor commented 1 month ago

https://github.com/nuxt-modules/ionic/blob/main/src/imports.ts

trydofor commented 1 month ago