Skip to content

华龙网 API

跳转 子文章 第一个

html
<hlx-template
  component-type="newsPage"
  component-query-option="{'columnIds':[],'start':0,'count':1,'showMedium':'PC'}"
  component-variable="newsList"
></hlx-template>

<script th:inline="javascript">
  var data = [[${newsList}]];
  console.log("数据为:", data)

  window.location.href = data[0].article.pcUrl
</script>

跳转 子栏目 第一个

html
<hlx-template
  component-type="columns"
  component-query-option="{'columnIds':[],'showMedium':'PC','columnScope':'SON'}"
  component-variable="columnlist"
></hlx-template>

<script th:inline="javascript">
  var data = [[${columnlist}]];
  console.log("数据为:", data)

  window.location.href = data[0].urlPc
</script>