mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-23 14:01:20 +08:00
refactor(components): update to latest stencil api
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
import { Component, h, VNodeData } from '@stencil/core';
|
||||
import { Component } from '@stencil/core';
|
||||
|
||||
|
||||
/**
|
||||
* @name Slide
|
||||
@ -17,7 +18,8 @@ import { Component, h, VNodeData } from '@stencil/core';
|
||||
styleUrl: 'slide.scss'
|
||||
})
|
||||
export class Slide {
|
||||
hostData(): VNodeData {
|
||||
|
||||
hostData() {
|
||||
return {
|
||||
class: {
|
||||
'slide-zoom': true,
|
||||
|
@ -1,6 +1,7 @@
|
||||
import { Component, h, Prop, Ionic } from '@stencil/core';
|
||||
import { Component, Element, Prop } from '@stencil/core';
|
||||
import { Swiper } from './vendor/swiper';
|
||||
|
||||
|
||||
/**
|
||||
* @name Slides
|
||||
* @description
|
||||
@ -29,7 +30,7 @@ import { Swiper } from './vendor/swiper';
|
||||
})
|
||||
export class Slides {
|
||||
swiper: any;
|
||||
$el: HTMLElement;
|
||||
@Element() el: HTMLElement;
|
||||
|
||||
/**
|
||||
* @input {string} The animation effect of the slides.
|
||||
@ -168,7 +169,7 @@ export class Slides {
|
||||
|
||||
emitEvent(eventName: string) {
|
||||
return (data: any) => {
|
||||
Ionic.emit(this, eventName, data);
|
||||
Core.emit(this.el, eventName, data);
|
||||
};
|
||||
}
|
||||
|
||||
@ -223,7 +224,7 @@ export class Slides {
|
||||
if (!this._init) {
|
||||
console.debug(`ion-slides, init`);
|
||||
|
||||
this.container = this.$el.children[0] as HTMLElement;
|
||||
this.container = this.el.children[0] as HTMLElement;
|
||||
|
||||
var swiperOptions = {
|
||||
height: this.height,
|
||||
|
Reference in New Issue
Block a user