Description
Prerequisites
- I have read the Contributing Guidelines.
- I agree to follow the Code of Conduct.
- I have searched for existing issues that already report this problem, without success.
Ionic Framework Version
- v4.x
- v5.x
- v6.x
Current Behavior
When I add classes to the <ion-page>
element, the ion-page
class and the ion-page-invisible
class (when in router outlet) are overridden by my own class attribute, which causes the page to be displayed incorrectly.
Expected Behavior
The class attribute is inherited correctly, so both my custom classes and the ionic critical classes are applied to the <div>
element that gets rendered by IonPage
Steps to Reproduce
- Create a new Vue-project with the Tabs template
- Open Tab1Page.vue
- Add a class to the ion-page component in the template section:
<ion-page class="test-class">
Code Reproduction URL
https://dashboard.ionicframework.com/app/d447a0a8/preview
Ionic Info
Ionic:
Ionic CLI : 6.18.1
Ionic Framework : @ionic/vue 6.0.7
Capacitor:
Capacitor CLI : 3.4.1
@capacitor/android : not installed
@capacitor/core : 3.4.1
@capacitor/ios : not installed
Utility:
cordova-res : not installed globally
native-run : 1.5.0
System:
NodeJS : v12.22.1
npm : 6.14.12
OS : macOS Monterey
Additional Information
Attrs gets processed later, which I think causes the components own class attribute to get overridden. When attrs.class
is defined, it should also be applied to the ['class']
section of this component