Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Auto Save

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <h1>State Park App: The API - Part 2</h1>
<p>Below is the tabular representation of <a href="https://docs.google.com/spreadsheets/d/1xFKuguz_frWTfkhDg0MbEXHaDtVn7qHigcpUl7zADFA/edit?usp=sharing">https://docs.google.com/spreadsheets/d/1xFKuguz_frWTfkhDg0MbEXHaDtVn7qHigcpUl7zADFA/edit?usp=sharing</a>.</p>

<div id="app">
	<table>
		<tr v-for="dataPoint in this.rejiggeredData">
			<td>{{dataPoint.name}}</td>
			<td>{{dataPoint.statePark}}</td>
			<td>{{dataPoint.recreationArea}}</td>
			<td>{{dataPoint.stateForest}}</td>
			<td>{{dataPoint.description}}</td>
			<td>{{dataPoint.physicalAddress}}</td>
			<td>{{dataPoint.county}}</td>
			<td>{{dataPoint.phoneNumber}}</td>
			<td>{{dataPoint.dnrWebsite}}</td>
			<td>{{dataPoint.directions}}</td>
			<td>{{dataPoint.hours}}</td>
			<td>{{dataPoint.LatLongCoordinates}}</td>
			<td>{{dataPoint.slug}}</td>
		</tr>
	</table>
	{{this.rejiggeredData}}
</div>
              
            
!

CSS

              
                
              
            
!

JS

              
                var app = new Vue({
  el: '#app',
  data: {
		data: [],
		rejiggeredData: []
  },
  mounted() {
    axios
    .get("https://spreadsheets.google.com/feeds/cells/1xFKuguz_frWTfkhDg0MbEXHaDtVn7qHigcpUl7zADFA/1/public/full?alt=json")
      .then(response=> (this.data = response.data.feed))
  },
  watch: {
    data: function () {
			// Loop over the array and rearrange it into a more usable form
			// Spreadsheet columns (there are 13): "The name of the property", "Is it a state park?", "Is it a recreation area?", "Is it a state forest?", "Description", "Physical Address", "County", "Phone number", "DNR Website URL", "Directions for getting to the property", "Hours", "The Latitude / Longitude coordinates", "Slug"
			for (var i = 0; i < this.data.entry.length; i+=13) {
				this.rejiggeredData.push({name:this.data.entry[i].content.$t, statePark:this.data.entry[i+1].content.$t, recreationArea:this.data.entry[i+2].content.$t, stateForest:this.data.entry[i+3].content.$t, description:this.data.entry[i+4].content.$t, physicalAddress:this.data.entry[i+5].content.$t, county:this.data.entry[i+6].content.$t, phoneNumber:this.data.entry[i+7].content.$t, dnrWebsite:this.data.entry[i+8].content.$t, directions:this.data.entry[i+9].content.$t, hours:this.data.entry[i+10].content.$t, LatLongCoordinates:this.data.entry[i+11].content.$t, slug:this.data.entry[i+12].content.$t});
			}
    },
		rejiggeredData: function () {
			console.log(this.rejiggeredData);
		}
	}
})
              
            
!
999px

Console