class pageTopic {
    constructor() {
        this.$newsTypeNav = $('.news-type__item')
        this.$newsWrapList = $('.news-list-wrap')

        this.init()
    }
    init() {
        this.setNewsTypeNav()
    }
    setNewsTypeNav() {
        var self = this
        this.$newsTypeNav.click(function () {
            var _this = $(this)
            if (_this.hasClass('active')) return

            var index = _this.index()
            _this.addClass('active')
                .siblings().removeClass('active')

            self.$newsWrapList.removeClass('active')
                .eq(index).addClass('active')
        })
    }
}
$(() => {
    new pageTopic
})
