[英]How to display RSS Feed (Google Alerts) on my Vue.js page?
我很难在我的vue.js
应用程序上显示一系列文章。
我不确定这是否是正确的方法。 我已经导入 axios 作为这样做的一种方式。 我正在尝试显示以下 RSS 提要: https://www.google.ie/alerts/feeds/10663948362751557705/4511034072220974544
我的谷歌组件:
<template>
<div class="google">
</div>
</template>
<script>
import axios from 'axios';
export default {
mounted() {
axios.get('https://www.google.ie/alerts/feeds/10663948362751557705/4511034072220974544')
.then(function (response) {
// handle success
console.log(response);
})
.catch(function (error) {
// handle error
console.log(error);
})
}
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
h3 {
margin: 40px 0 0;
}
ul {
list-style-type: none;
padding: 0;
}
li {
display: inline-block;
margin: 0 10px;
}
a {
color: #42b983;
}
</style>
我的应用程序.vue:
<template>
<div id="app">
<GoogleAlerts> </GoogleAlerts>
</div>
</template>
<script>
import GoogleAlerts from './components/GoogleAlerts.vue'
export default {
name: 'app',
components: {
GoogleAlerts
},
data () {
return {
}
},
}
</script>
<style>
#app {
font-family: 'Avenir', Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-align: center;
color: #2c3e50;
margin-top: 60px;
}
</style>
我的 main.js:
import Vue from 'vue'
import App from './App.vue'
import axios from 'axios'
import VueAxios from 'vue-axios'
Vue.use(VueAxios, axios)
Vue.config.productionTip = false
new Vue({
render: h => h(App),
}).$mount('#app')
如何在我的 Vue.js 页面上显示 RSS 源(Google 警报)?
任何想法将不胜感激。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.